https://www.trccompsci.online/mediawiki/api.php?action=feedcontributions&user=Mfrederick&feedformat=atomTRCCompSci - AQA Computer Science - User contributions [en-gb]2024-03-29T13:09:34ZUser contributionsMediaWiki 1.31.6https://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4423Graphs2017-12-06T21:20:03Z<p>Mfrederick: </p>
<hr />
<div>[[File:Graph-4.jpg|300px|thumb|right]]<br />
<br />
==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
Each edge/arc has an associated value, which can be used for distance, cost and so on.<br />
===vertex/node===<br />
An entity, location within the graph (represented by a circle).<br />
===edge/arc===<br />
A connection between two vertex/nodes<br />
===undirected graph===<br />
You can travel either direction on an edge/arc. For example an edge between A & B allows movement from A to B and from B to A.<br />
===directed graph===<br />
Each edge/arc will have an arrow to indicate the direction of travel. This will require additional edges to cover both directions.<br />
<br />
==Adjacency List==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
<br />
==Adjacency Matrix==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! List!! Matrix <br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4422Graphs2017-12-06T21:19:32Z<p>Mfrederick: Undo revision 4418 by Jared (talk)</p>
<hr />
<div>[[File:Graph-4.jpg|300px|thumb|right]]<br />
<br />
==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
Each edge/arc has an associated value, which can be used for distance, cost and so on.<br />
===vertex/node===<br />
An entity, location within the graph (represented by a circle).<br />
===edge/arc===<br />
A connection between two vertex/nodes<br />
===undirected graph===<br />
You can travel either direction on an edge/arc. For example an edge between A & B allows movement from A to B and from B to A.<br />
===directed graph===<br />
Each edge/arc will have an arrow to indicate the direction of travel. This will require additional edges to cover both directions.<br />
<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! List!! Matrix <br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Trees-2.jpg&diff=4406File:Trees-2.jpg2017-12-03T12:29:22Z<p>Mfrederick: Mfrederick uploaded a new version of File:Trees-2.jpg</p>
<hr />
<div>Trees-2</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Trees&diff=4405Trees2017-12-03T12:27:15Z<p>Mfrederick: /* Example */</p>
<hr />
<div>[[File:Tree-1.jpg|300px|thumb|right]]<br />
<br />
==What is a Tree==<br />
A tree is a '''connected''', '''undirected''' graph with '''no cycles''' in it.<br />
<br />
===Connected===<br />
All nodes must be connected to other nodes so that no part of the graph is separated. An unconnected graph is essentially 2 separate graphs.<br />
<br />
===Undirected===<br />
A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.<br />
<br />
===No Cycles===<br />
A run of interconnected nodes that return to the point of origin.<br />
<br />
==What is a Rooted Tree==<br />
A tree with one vertex singled out as a starting point.<br />
<br />
==What is a Binary Tree==<br />
A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.<br />
<br />
==What is a Binary Tree Search==<br />
A binary tree can be created from a list of data:<br />
<br />
#The first item in the list will be the root of your tree.<br />
#You will then add an item to the tree by firstly comparing the new item to the root. <br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. <br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root.<br />
#The next item in the list will again be compared to the root.<br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. If the root already has a node to the left, the new item will be compared to this node as well.<br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root. If the root already has a node to the Right, the new item will be compared to this node as well.<br />
<br />
===Example===<br />
The tree below shows the insertion of: 38, 13, 51, 10, 12, 40, 84, 25, 89, 37, 66, 95 (added in this order)<br />
<br />
[[File:Trees-2.jpg|500px]]<br />
<br />
The search phase is very similar, you start with the number you wish to find and compare it to the root. Travel from node to node using the rules:<br />
#Compare the search value with the node, if they are not equal:<br />
##If it is alphabetically Lower than the node travel to the left of the node. <br />
##If it is alphabetically Higher than the node travel to the right of the node.<br />
#If you reach a point and no path can be taken then the item is not in the list.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Trees&diff=4404Trees2017-12-03T12:26:56Z<p>Mfrederick: /* What is a Binary Tree Search */</p>
<hr />
<div>[[File:Tree-1.jpg|300px|thumb|right]]<br />
<br />
==What is a Tree==<br />
A tree is a '''connected''', '''undirected''' graph with '''no cycles''' in it.<br />
<br />
===Connected===<br />
All nodes must be connected to other nodes so that no part of the graph is separated. An unconnected graph is essentially 2 separate graphs.<br />
<br />
===Undirected===<br />
A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.<br />
<br />
===No Cycles===<br />
A run of interconnected nodes that return to the point of origin.<br />
<br />
==What is a Rooted Tree==<br />
A tree with one vertex singled out as a starting point.<br />
<br />
==What is a Binary Tree==<br />
A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.<br />
<br />
==What is a Binary Tree Search==<br />
A binary tree can be created from a list of data:<br />
<br />
#The first item in the list will be the root of your tree.<br />
#You will then add an item to the tree by firstly comparing the new item to the root. <br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. <br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root.<br />
#The next item in the list will again be compared to the root.<br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. If the root already has a node to the left, the new item will be compared to this node as well.<br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root. If the root already has a node to the Right, the new item will be compared to this node as well.<br />
<br />
===Example===<br />
The tree below shows the insertion of: 38, 13, 51, 10, 12, 40, 84, 25, 89, 37, 66, 95 (added in this order)<br />
<br />
[[File:Trees-2.jpg|200px]]<br />
<br />
The search phase is very similar, you start with the number you wish to find and compare it to the root. Travel from node to node using the rules:<br />
#Compare the search value with the node, if they are not equal:<br />
##If it is alphabetically Lower than the node travel to the left of the node. <br />
##If it is alphabetically Higher than the node travel to the right of the node.<br />
#If you reach a point and no path can be taken then the item is not in the list.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Trees&diff=4403Trees2017-12-03T12:26:31Z<p>Mfrederick: /* What is a Binary Tree Search */</p>
<hr />
<div>[[File:Tree-1.jpg|300px|thumb|right]]<br />
<br />
==What is a Tree==<br />
A tree is a '''connected''', '''undirected''' graph with '''no cycles''' in it.<br />
<br />
===Connected===<br />
All nodes must be connected to other nodes so that no part of the graph is separated. An unconnected graph is essentially 2 separate graphs.<br />
<br />
===Undirected===<br />
A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.<br />
<br />
===No Cycles===<br />
A run of interconnected nodes that return to the point of origin.<br />
<br />
==What is a Rooted Tree==<br />
A tree with one vertex singled out as a starting point.<br />
<br />
==What is a Binary Tree==<br />
A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.<br />
<br />
==What is a Binary Tree Search==<br />
A binary tree can be created from a list of data:<br />
<br />
#The first item in the list will be the root of your tree.<br />
#You will then add an item to the tree by firstly comparing the new item to the root. <br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. <br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root.<br />
#The next item in the list will again be compared to the root.<br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. If the root already has a node to the left, the new item will be compared to this node as well.<br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root. If the root already has a node to the Right, the new item will be compared to this node as well.<br />
<br />
===Example===<br />
The tree below shows the insertion of: 38, 13, 51, 10, 12, 40, 84, 25, 89, 37, 66, 95 (added in this order)<br />
<br />
[[File:Trees-2.jpg]]<br />
<br />
The search phase is very similar, you start with the number you wish to find and compare it to the root. Travel from node to node using the rules:<br />
#Compare the search value with the node, if they are not equal:<br />
##If it is alphabetically Lower than the node travel to the left of the node. <br />
##If it is alphabetically Higher than the node travel to the right of the node.<br />
#If you reach a point and no path can be taken then the item is not in the list.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Trees&diff=4402Trees2017-12-03T12:26:18Z<p>Mfrederick: /* Example */</p>
<hr />
<div>[[File:Tree-1.jpg|300px|thumb|right]]<br />
<br />
==What is a Tree==<br />
A tree is a '''connected''', '''undirected''' graph with '''no cycles''' in it.<br />
<br />
===Connected===<br />
All nodes must be connected to other nodes so that no part of the graph is separated. An unconnected graph is essentially 2 separate graphs.<br />
<br />
===Undirected===<br />
A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.<br />
<br />
===No Cycles===<br />
A run of interconnected nodes that return to the point of origin.<br />
<br />
==What is a Rooted Tree==<br />
A tree with one vertex singled out as a starting point.<br />
<br />
==What is a Binary Tree==<br />
A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.<br />
<br />
==What is a Binary Tree Search==<br />
A binary tree can be created from a list of data:<br />
<br />
#The first item in the list will be the root of your tree.<br />
#You will then add an item to the tree by firstly comparing the new item to the root. <br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. <br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root.<br />
#The next item in the list will again be compared to the root.<br />
##If it is alphabetically Lower than the root the new item will be placed on the left of the root. If the root already has a node to the left, the new item will be compared to this node as well.<br />
##If it is alphabetically Higher than the root the new item will be place to the right of the root. If the root already has a node to the Right, the new item will be compared to this node as well.<br />
<br />
===Example===<br />
The tree below shows the insertion of: 38, 13, 51, 10, 12, 40, 84, 25, 89, 37, 66, 95 (added in this order)<br />
<br />
[[File:Trees-2.jpg|thumb]]<br />
<br />
The search phase is very similar, you start with the number you wish to find and compare it to the root. Travel from node to node using the rules:<br />
#Compare the search value with the node, if they are not equal:<br />
##If it is alphabetically Lower than the node travel to the left of the node. <br />
##If it is alphabetically Higher than the node travel to the right of the node.<br />
#If you reach a point and no path can be taken then the item is not in the list.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Trees-2.jpg&diff=4401File:Trees-2.jpg2017-12-03T12:25:54Z<p>Mfrederick: </p>
<hr />
<div>Trees-2</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4400Graphs2017-12-03T12:14:05Z<p>Mfrederick: /* Comparison of List VS Matrix */</p>
<hr />
<div>[[File:Graph-4.jpg|300px|thumb|right]]<br />
<br />
==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
Each edge/arc has an associated value, which can be used for distance, cost and so on.<br />
===vertex/node===<br />
An entity, location within the graph (represented by a circle).<br />
===edge/arc===<br />
A connection between two vertex/nodes<br />
===undirected graph===<br />
You can travel either direction on an edge/arc. For example an edge between A & B allows movement from A to B and from B to A.<br />
===directed graph===<br />
Each edge/arc will have an arrow to indicate the direction of travel. This will require additional edges to cover both directions.<br />
<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! List!! Matrix <br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=TRCCompSci_-_AQA_Computer_Science:Revision&diff=4309TRCCompSci - AQA Computer Science:Revision2017-11-28T16:50:40Z<p>Mfrederick: Mfrederick moved page Revision to AQA Computer Science:Revision</p>
<hr />
<div>== AL2 Mock Exam W/C 04/12 ==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Revision&diff=4310Revision2017-11-28T16:50:40Z<p>Mfrederick: Mfrederick moved page Revision to AQA Computer Science:Revision</p>
<hr />
<div>#REDIRECT [[AQA Computer Science:Revision]]</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=TRCCompSci_-_AQA_Computer_Science:Revision&diff=4308TRCCompSci - AQA Computer Science:Revision2017-11-28T16:49:53Z<p>Mfrederick: Created page with "== AL2 Mock Exam W/C 04/12 =="</p>
<hr />
<div>== AL2 Mock Exam W/C 04/12 ==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Stacks&diff=4307Stacks2017-11-28T16:42:55Z<p>Mfrederick: </p>
<hr />
<div>A stack is a '''last in, first out''' data structure. A stack can only have data added or removed from the top. Imagine a stack of plates in a restaurant, you can only take the top plate and you can't grab one from the middle.<br />
<br />
The stack has limited size and this must be defined. The '''Stack Pointer''' will always point to the value at the top of the stack. It will start at zero for an empty stack and the maximum value should be equal to the size of the stack.<br />
<br />
==Check for Full==<br />
A stack must have a maximum size of the stack defined, this is often called StackMax. This will be used to check if the stack is currently full, it will do this by comparing the stack pointer and the StackMax.<br />
<br />
<syntaxhighlight lang=python><br />
procedure TestFull (ref Stack, ref SP)<br />
begin<br />
if SP = StackMax then<br />
output ‘no room on stack’<br />
else<br />
output ‘room available on stack’<br />
endif<br />
end { TestFull}<br />
</syntaxhighlight><br />
<br />
==Check for Empty==<br />
Testing for empty only requires the stack pointer, so if the stack pointer is zero the stack is empty.<br />
<br />
<syntaxhighlight lang=python><br />
procedure TestEmpty (ref Stack, ref SP)<br />
begin<br />
if SP = 0 then<br />
output ‘stack is empty’<br />
else<br />
output ‘stack is not empty’<br />
endif<br />
end {TestEmpty}<br />
</syntaxhighlight><br />
<br />
==Push==<br />
When an item is pushed it is added to the top of the stack. The stack pointer points to the item at the top of the stack, so the stack pointer is incremented and then the data item is stored in that location of the stack. remember this can only be carried out if the stack is not currently full.<br />
<br />
<syntaxhighlight lang=python><br />
procedure TestAndPush (ref Stack, ref SP)<br />
begin<br />
if SP = StackMax then<br />
output ‘no room on stack’<br />
else<br />
input DataItem<br />
SP := SP + 1<br />
Stack[SP] : = DataItem<br />
endif<br />
end { TestAndPush}<br />
</syntaxhighlight><br />
<br />
==Pop==<br />
Pop will remove the top item from the stack. You will need to store the item at the top of the stack (location of stack pointer), and then decrement the stack pointer by 1. The item may not be deleted it will just be overwritten the next time that location is used.<br />
<br />
Remember a pop can only be performed if the stack is not currently empty.<br />
<br />
<syntaxhighlight lang=python><br />
procedure TestAndPop (ref Stack, ref SP)<br />
begin<br />
if SP = 0 then<br />
output ‘stack is empty’<br />
else<br />
DataItem := Stack[SP]<br />
SP := SP – 1<br />
output DataItem<br />
endif<br />
end {TestAndPop}<br />
</syntaxhighlight><br />
<br />
==Peek==<br />
Allows you to get the value from the top of the stack, without actually popping it. This is achieved by following the same algorithm for a pop, however, the stack pointer is never changed.<br />
<br />
Again remember this can only be carried out on a stack that currently contains values, if it is empty it will crash.<br />
<br />
<syntaxhighlight lang=python><br />
procedure TestAndPeek (ref Stack, ref SP)<br />
begin<br />
if SP = 0 then<br />
output ‘stack is empty’<br />
else<br />
DataItem := Stack[SP]<br />
output DataItem<br />
endif<br />
end {TestAndPeek}<br />
</syntaxhighlight></div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Hashing&diff=4293Hashing2017-11-26T20:55:30Z<p>Mfrederick: </p>
<hr />
<div>[[File:Hashing-1.jpg|600px|thumb|right]]<br />
<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
<br />
=What is hashing=<br />
Hashing is the process of calculating a fixed length value from another value, such as a string. A value is passed into a Hash Function and the function returns a Hash Value.<br />
This process is used in cryptography. Rather than storing a 'secret' (such as a password) as plain text, it's hash value is calculated and stored in its place. Therefore, if the storage database was compromised and an attacker could see the stored passwords, they wouldn't know their actual value - only the hash. It is intentionally difficult to reverse the hashing process without the original parameters and function used to create it.<br />
<br />
Hashing is also used for storing large quantities of data in a hashing table. The data is converted to an integer hash, which is then used to 'search' the table to fetch the relevant data. This has the advantage that finding an integer from a list of integers is much faster than searching for a string within a list of strings.<br />
<br />
=Key Terms=<br />
===Hash Value===<br />
===Hash Key===<br />
===Hash Function===<br />
<br />
<br />
=Collisions=<br />
Collisions occur when two values, when entered into the same hashing function, return the same hash value. These are inevitable when dealing with huge quantities of values no matter how complex the function. The creator can take steps to reduce the number of collisions that will occur but they are impossible to prevent.<br />
<br />
==Handling Collisions==<br />
===Rehashing / Closed===<br />
<br />
===Linked List of Collided Values / Open===<br />
<br />
=Example=<br />
PHP's crypt() function is a hashing function that supports multiple methods & standards, designed for password cryptography. They use a salt, which is additional data that is added to the value to be hashed in order to make it longer and more complex.<br />
<br />
From PHP.net Manual on crypt:<br />
<syntaxhighlight lang="php" line>echo 'SHA-512: ' . crypt('rasmuslerdorf', '$6$rounds=5000$usesomesillystringforsalt$') . "<br>";<br />
Output: SHA-512: $6$rounds=5000$usesomesillystri$D4IrlXatmP7rx3P3InaxBeoomnAihCKRVQP22JZ6EY47Wc6BkroIuUUBOov1i.S5KPgErtP/EN5mcO.ChWQW21<br />
</syntaxhighlight><br />
The function hashes 'rasmuslerdorf' (creator of PHP) and outputs it, using the salt '$6$rounds=5000$usesomesillystringforsalt$'.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Hashing&diff=4292Hashing2017-11-26T20:54:45Z<p>Mfrederick: </p>
<hr />
<div>[[File:Hashing-1.jpg|600px|thumb|right]]<br />
<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
<br />
=What is hashing=<br />
Hashing is the process of calculating a fixed length value from another value, such as a string. A value is passed into a Hash Function and the function returns a Hash Value.<br />
This process is used in cryptography. Rather than storing a 'secret' (such as a password) as plain text, it's hash value is calculated and stored in it's place. Therefore, if the storage database was compromised and an attacker could see the stored passwords, they wouldn't know their actual value - only the hash. It is intentionally difficult to reverse the hashing process without the original parameters and function used to create it.<br />
<br />
Hashing is also used for storing large quantities of data in a hashing table. The data is converted to an integer hash, which is then used to 'search' the table to fetch the relevant data. This has the advantage that finding an integer from a list of integers is much faster than searching for a string within a list of strings.<br />
<br />
=Key Terms=<br />
===Hash Value===<br />
===Hash Key===<br />
===Hash Function===<br />
<br />
<br />
=Collisions=<br />
Collisions occur when two values, when entered into the same hashing function, return the same hash value. These are inevitable when dealing with huge quantities of values no matter how complex the function. The creator can take steps to reduce the number of collisions that will occur but they are impossible to prevent.<br />
<br />
==Handling Collisions==<br />
===Rehashing / Closed===<br />
<br />
===Linked List of Collided Values / Open===<br />
<br />
=Example=<br />
PHP's crypt() function is a hashing function that supports multiple methods & standards, designed for password cryptography. They use a salt, which is additional data that is added to the value to be hashed in order to make it longer and more complex.<br />
<br />
From PHP.net Manual on crypt:<br />
<syntaxhighlight lang="php" line>echo 'SHA-512: ' . crypt('rasmuslerdorf', '$6$rounds=5000$usesomesillystringforsalt$') . "<br>";<br />
Output: SHA-512: $6$rounds=5000$usesomesillystri$D4IrlXatmP7rx3P3InaxBeoomnAihCKRVQP22JZ6EY47Wc6BkroIuUUBOov1i.S5KPgErtP/EN5mcO.ChWQW21<br />
</syntaxhighlight><br />
The function hashes 'rasmuslerdorf' (creator of PHP) and outputs it, using the salt '$6$rounds=5000$usesomesillystringforsalt$'.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Hashing&diff=4291Hashing2017-11-26T20:54:31Z<p>Mfrederick: </p>
<hr />
<div>[[File:Hashing-1.jpg|600px|thumb|right]]<br />
<br />
<br /><br />
<br /><br />
<br />
=What is hashing=<br />
Hashing is the process of calculating a fixed length value from another value, such as a string. A value is passed into a Hash Function and the function returns a Hash Value.<br />
This process is used in cryptography. Rather than storing a 'secret' (such as a password) as plain text, it's hash value is calculated and stored in it's place. Therefore, if the storage database was compromised and an attacker could see the stored passwords, they wouldn't know their actual value - only the hash. It is intentionally difficult to reverse the hashing process without the original parameters and function used to create it.<br />
<br />
Hashing is also used for storing large quantities of data in a hashing table. The data is converted to an integer hash, which is then used to 'search' the table to fetch the relevant data. This has the advantage that finding an integer from a list of integers is much faster than searching for a string within a list of strings.<br />
<br />
=Key Terms=<br />
===Hash Value===<br />
===Hash Key===<br />
===Hash Function===<br />
<br />
<br />
=Collisions=<br />
Collisions occur when two values, when entered into the same hashing function, return the same hash value. These are inevitable when dealing with huge quantities of values no matter how complex the function. The creator can take steps to reduce the number of collisions that will occur but they are impossible to prevent.<br />
<br />
==Handling Collisions==<br />
===Rehashing / Closed===<br />
<br />
===Linked List of Collided Values / Open===<br />
<br />
=Example=<br />
PHP's crypt() function is a hashing function that supports multiple methods & standards, designed for password cryptography. They use a salt, which is additional data that is added to the value to be hashed in order to make it longer and more complex.<br />
<br />
From PHP.net Manual on crypt:<br />
<syntaxhighlight lang="php" line>echo 'SHA-512: ' . crypt('rasmuslerdorf', '$6$rounds=5000$usesomesillystringforsalt$') . "<br>";<br />
Output: SHA-512: $6$rounds=5000$usesomesillystri$D4IrlXatmP7rx3P3InaxBeoomnAihCKRVQP22JZ6EY47Wc6BkroIuUUBOov1i.S5KPgErtP/EN5mcO.ChWQW21<br />
</syntaxhighlight><br />
The function hashes 'rasmuslerdorf' (creator of PHP) and outputs it, using the salt '$6$rounds=5000$usesomesillystringforsalt$'.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Hashing&diff=4290Hashing2017-11-26T20:54:06Z<p>Mfrederick: </p>
<hr />
<div>[[File:Hashing-1.jpg|400px|thumb|right]]<br />
<br />
<br /><br />
<br /><br />
<br />
=What is hashing=<br />
Hashing is the process of calculating a fixed length value from another value, such as a string. A value is passed into a Hash Function and the function returns a Hash Value.<br />
This process is used in cryptography. Rather than storing a 'secret' (such as a password) as plain text, it's hash value is calculated and stored in it's place. Therefore, if the storage database was compromised and an attacker could see the stored passwords, they wouldn't know their actual value - only the hash. It is intentionally difficult to reverse the hashing process without the original parameters and function used to create it.<br />
<br />
Hashing is also used for storing large quantities of data in a hashing table. The data is converted to an integer hash, which is then used to 'search' the table to fetch the relevant data. This has the advantage that finding an integer from a list of integers is much faster than searching for a string within a list of strings.<br />
<br />
=Key Terms=<br />
===Hash Value===<br />
===Hash Key===<br />
===Hash Function===<br />
<br />
<br />
=Collisions=<br />
Collisions occur when two values, when entered into the same hashing function, return the same hash value. These are inevitable when dealing with huge quantities of values no matter how complex the function. The creator can take steps to reduce the number of collisions that will occur but they are impossible to prevent.<br />
<br />
==Handling Collisions==<br />
===Rehashing / Closed===<br />
<br />
===Linked List of Collided Values / Open===<br />
<br />
=Example=<br />
PHP's crypt() function is a hashing function that supports multiple methods & standards, designed for password cryptography. They use a salt, which is additional data that is added to the value to be hashed in order to make it longer and more complex.<br />
<br />
From PHP.net Manual on crypt:<br />
<syntaxhighlight lang="php" line>echo 'SHA-512: ' . crypt('rasmuslerdorf', '$6$rounds=5000$usesomesillystringforsalt$') . "<br>";<br />
Output: SHA-512: $6$rounds=5000$usesomesillystri$D4IrlXatmP7rx3P3InaxBeoomnAihCKRVQP22JZ6EY47Wc6BkroIuUUBOov1i.S5KPgErtP/EN5mcO.ChWQW21<br />
</syntaxhighlight><br />
The function hashes 'rasmuslerdorf' (creator of PHP) and outputs it, using the salt '$6$rounds=5000$usesomesillystringforsalt$'.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Hashing-1.jpg&diff=4289File:Hashing-1.jpg2017-11-26T20:53:48Z<p>Mfrederick: </p>
<hr />
<div>Hashing-1</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4288Graphs2017-11-26T20:37:27Z<p>Mfrederick: </p>
<hr />
<div>[[File:Graph-4.jpg|300px|thumb|right]]<br />
<br />
==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! Matrix !! List<br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Graph-4.jpg&diff=4287File:Graph-4.jpg2017-11-26T20:37:15Z<p>Mfrederick: </p>
<hr />
<div>Graph-4</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Trees&diff=4286Trees2017-11-26T20:31:34Z<p>Mfrederick: </p>
<hr />
<div>[[File:Tree-1.jpg|300px|thumb|right]]<br />
<br />
==What is a Tree==<br />
A tree is a '''connected''', '''undirected''' graph with '''no cycles''' in it.<br />
<br />
===Connected===<br />
<br />
===Undirected===<br />
<br />
===No Cycles===<br />
<br />
==What is a Rooted Tree==<br />
A tree with one vertex singled out as a starting point.<br />
<br />
==What is a Binary Tree==<br />
A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.<br />
<br />
==What is a Binary Tree Search==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Tree-1.jpg&diff=4285File:Tree-1.jpg2017-11-26T20:31:16Z<p>Mfrederick: </p>
<hr />
<div>Tree-1</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4284Graphs2017-11-26T13:14:53Z<p>Mfrederick: /* Comparison of List VS Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! Matrix !! List<br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4283Graphs2017-11-26T13:14:37Z<p>Mfrederick: /* Comparison of List VS Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==<br />
{| class="wikitable"<br />
|-<br />
! Matrix !! List<br />
|-<br />
| Its quicker to find an edge || Needs to look at all items<br />
|-<br />
| Less space, no wastage || Stores information about each edge<br />
|-<br />
| <br />
|}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4282Graphs2017-11-26T13:12:43Z<p>Mfrederick: /* Adjacency List */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4281Graphs2017-11-26T13:12:26Z<p>Mfrederick: /* Adjacency List */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph to make things easier.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4280Graphs2017-11-26T13:11:59Z<p>Mfrederick: /* Adjacency Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph t make things easier.<br />
<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4279Graphs2017-11-26T13:11:42Z<p>Mfrederick: /* Adjacency Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br /><br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph t make things easier.<br />
<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4278Graphs2017-11-26T13:09:38Z<p>Mfrederick: /* Adjacency List */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br />
==Adjacency List==<br />
[[File:Graph-3.jpg|thumb|300px]]<br />
This is a list shown in binary for the values that are going to be connected. It usually helps to transfer the matrices into a list first before you turn it into a graph t make things easier.<br />
<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Graph-3.jpg&diff=4277File:Graph-3.jpg2017-11-26T13:08:18Z<p>Mfrederick: </p>
<hr />
<div>Graph-3</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4276Graphs2017-11-26T12:56:29Z<p>Mfrederick: /* Adjacency Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|300px]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4275Graphs2017-11-26T12:55:59Z<p>Mfrederick: /* Adjacency Matrix */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
[[File:Graph-2.jpg|thumb|200px]]]]<br />
An adjacency matrix is a list showing the what vertexes are connected to their neighbors. This is represented by a list showing what vertex is connected to the other.<br />
<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Graph-2.jpg&diff=4274File:Graph-2.jpg2017-11-26T12:54:26Z<p>Mfrederick: </p>
<hr />
<div>Graph 2</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4273Graphs2017-11-26T12:45:54Z<p>Mfrederick: /* What is a graph */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
Edges can also be called connectors and vertex can also be called nodes or entries.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4272Graphs2017-11-26T12:44:59Z<p>Mfrederick: /* What is a graph */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
Vertices connected by an edge (see picture) are called Neighbours.<br />
<br />
The degree of a vertex is how many things are connected to it, in the picture, there would be 2.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4271Graphs2017-11-26T12:43:09Z<p>Mfrederick: /* What is a graph */</p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
A graph is an abstract data structure. It can be used to solve routine problems.<br />
<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4270Graphs2017-11-26T12:42:11Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|200px]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4269Graphs2017-11-26T12:41:44Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|thumb|50px]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4268Graphs2017-11-26T12:41:07Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|50px|frame|right]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4267Graphs2017-11-26T12:40:47Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|frame|right|50px]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4266Graphs2017-11-26T12:39:49Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|frame|right|200px]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Graphs&diff=4265Graphs2017-11-26T12:37:58Z<p>Mfrederick: </p>
<hr />
<div>==What is a graph==<br />
[[File:Graph-1.jpg|frame|right]]<br />
==Terms==<br />
===weighted graph===<br />
===vertex/node===<br />
===edge/arc===<br />
===undirected graph===<br />
===directed graph===<br />
==Adjacency Matrix==<br />
==Adjacency List==<br />
==Comparison of List VS Matrix==</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Graph-1.jpg&diff=4264File:Graph-1.jpg2017-11-26T12:37:47Z<p>Mfrederick: </p>
<hr />
<div>Graph image</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=DisplayMenu&diff=3920DisplayMenu2017-11-14T13:45:27Z<p>Mfrederick: </p>
<hr />
<div><syntaxhighlight lang="c#"><br />
private static void DisplayMenu()<br />
{<br />
Console.WriteLine();<br />
Console.WriteLine("=========");<br />
Console.WriteLine("MAIN MENU");<br />
Console.WriteLine("=========");<br />
Console.WriteLine();<br />
Console.WriteLine("1. Play game with random start hand");<br />
Console.WriteLine("2. Play game with training start hand");<br />
Console.WriteLine("9. Quit");<br />
Console.WriteLine();<br />
}<br />
</syntaxhighlight><br />
This is just 9 console.writelines that can be called up for when needed. This doesn't have any functions in just able to display menu all choices would have to be handled by other parts of the program. This is easier to view by the programmer like this as you can clearly see what the text will look like when displayed.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=File:Pseudocode_(2)-1.png&diff=3095File:Pseudocode (2)-1.png2017-06-27T14:12:10Z<p>Mfrederick: Mfrederick uploaded a new version of File:Pseudocode (2)-1.png</p>
<hr />
<div></div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Selection&diff=2478Selection2017-04-06T06:55:33Z<p>Mfrederick: </p>
<hr />
<div>Selection uses if statements and switch statements. These allow your programs to make decisions or change the course of your program based on an input or a variable.<br />
==If / If Else==<br />
<br />
if statements work by performing an action only if a condition is reached. After the if command, the condition should be within round brackets, the contents of which should equate to true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}</syntaxhighlight><br />
This can also be paired with else, which will perform an action if the "if" condition is not met.<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}<br />
else<br />
{<br />
Console.WriteLine("A is not Greater Than B");<br />
}</syntaxhighlight><br />
<br />
==Else If==<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}<br />
else if (a > c)<br />
{<br />
Console.WriteLine("A is greater than C");<br />
}<br />
else<br />
{<br />
Console.WriteLine("A is not Greater Than B or C");<br />
}</syntaxhighlight><br />
<br />
==Switch / Case==<br />
<br />
Switch is basically a combined if and if else statement, and is used for a lot of different options.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ <br />
case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
}</syntaxhighlight> <br />
Default is an optional part of the switch method, which is used in case none of the other conditions are met.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ <br />
case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
default:<br />
x*= x;<br />
break;<br />
}</syntaxhighlight><br />
<br />
==Nesting Statements==<br />
Both if and switch statements can be nested, meaning that one statement can be contained within another.<br />
<br />
<syntaxhighlight lang="csharp" line> <br />
if (a > b)<br />
{<br />
if (b > 50)<br />
{<br />
Console.WriteLine("b is a very large number!");<br />
}<br />
}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Selection&diff=2477Selection2017-04-06T06:54:58Z<p>Mfrederick: </p>
<hr />
<div>Selection uses if statements and switch statements. These allow your programs to make decisions or change the course of your program based on an input or a variable.<br />
==If / If Else==<br />
<br />
if statements work by performing an action only if a condition is reached. After the if command, the condition should be within round brackets, the contents of which should equate to true or false.<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}</syntaxhighlight><br />
This can also be paired with else, which will perform an action if the "if" condition is not met.<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}<br />
else<br />
{<br />
Console.WriteLine("A is not Greater Than B");<br />
}</syntaxhighlight><br />
<br />
==Else If==<br />
<br />
<syntaxhighlight lang="csharp" line>if (a > b)<br />
{<br />
Console.WriteLine("A is greater than B");<br />
}<br />
else if (a > c)<br />
{<br />
Console.WriteLine("A is greater than C");<br />
}<br />
else<br />
{<br />
Console.WriteLine("A is not Greater Than B or C");<br />
}</syntaxhighlight><br />
<br />
==Switch / Case==<br />
<br />
Switch is basically a combined if and if else statement, and is used for a lot of different options.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ <br />
case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
}</syntaxhighlight> <br />
Default is an optional part of the switch method, which is used in case none of the other conditions are met.<br />
<syntaxhighlight lang="csharp" line>switch(x)<br />
{ <br />
case 1:<br />
x++;<br />
break;<br />
case 2:<br />
x--;<br />
break;<br />
default:<br />
x*= x;<br />
break;<br />
}</syntaxhighlight><br />
<br />
==Nesting Statements==<br />
Both if and switch statements can be nested, meaning that one statement can be contained within another.<br />
<br />
<syntaxhighlight lang="csharp" line> if (a > b)<br />
{<br />
if (b > 50)<br />
{<br />
Console.WriteLine("b is a very large number!");<br />
}<br />
}</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Fundamentals_of_computer_organisation_and_architecture&diff=1917Fundamentals of computer organisation and architecture2017-03-09T11:56:15Z<p>Mfrederick: /* 3 Box Model */</p>
<hr />
<div>=3 Box Model=<br />
[[File:3_Box.png|right|frame|x50px]]<br />
==Processor==<br />
The CPU is what processes the data, it is the brain of the computer. It is responsible for executing commands, running programs and controls parts of the system and monitors them. The CPU is the most complex part of any system but it is a big Finite State Machine.<br />
==Main Memory==<br />
Memory is the simplest part of the computer as it stores data temporally, it acts as a post it note for the computer and when the computer is turned off, it is erased (this means that it is volatile). <br />
==I/O==<br />
Input/Output or I/O is the communication between a device such as a computer and external devices. The Inputs are information received by the computer from external devices and the Output is the information sent by the computer out to external devices.<br />
<br />
I/O devices are hardware used by a human in order to interact with the computer. For example a keyboard and mouse are used to operate computers and are necessary for use to be able to use a computer efficiently, these are input devices, while the computer sends out information to the monitors in order for the person using the computer to see what is happening, information is also sent from the computer to printer telling it where to apply ink to the page and what colors to use when printing, these are output devices. There are also devices used to communicate between computers, such as modems or network cards, devices like these act as both input and output devices.<br />
<br />
Input devices are devices that take physical movements from the user and convert those inputs into input signals which the computer can understand.<br />
<br />
Output devices are devices that take signals from the computer and and convert them into something the user can understand, e.g the display on a monitor or the page printed by the printer.<br />
<br />
[[File:Output system.jpg]]<br />
<br />
=extended model with split I/O=<br />
<br />
=System Bus=<br />
<br />
==Control Bus==<br />
The control bus Carries control signals to and from the processor to main memory and other device controllers.<br />
<br />
==Address Bus==<br />
Carries addresses from the processor to main memory and other device controllers, such as addresses to take information from and send information to on the hard drive of a computer, as well as the addresses of anywhere else in the computer data may need to be sent to..<br />
<br />
==Data Bus==<br />
Carries data to and from main memory and other device controllers and instructions from memory to the processor.<br />
<br />
=Stored Program Concept=<br />
The stored program concept states that a program must reside in main memory to be executed. Instructions are fetched from main memory and executed in sequence.<br />
<br />
=von Neumann Architecture=<br />
von Neumann Architecture is a type of computer architecture, based on the design created by John von Neumann in 1945.<br />
<br />
Computer systems that use von Neumann Architecture contain three main components; the central processing unit (CPU), memory, and input/output devices (I/O), which are all connected together using the system bus.<br />
<br />
The memory stores the information (data/program). <br />
The processing unit handles computation/processing of information.<br />
The Input receives the information from input devices such as mouse and keyboard.<br />
The Output sends information out to devices such as the monitor or printer.<br />
The Control unit endures that the other components are performing their tasks correctly.<br />
<br />
[[File:von Neumann Architecture.jpg]]<br />
<br />
=Harvard Architecture=<br />
Harvard Architecture is a type of computer architecture based on the Harvard Mark 1 relay-based computer, which stored instructions on punched tape and data in electro-mechanical counters.<br />
<br />
Computer systems that use Harvard Architecture have their memory split into two parts. One part of the memory is used for data storage and handling, while the other half is used to run programs. Each part of the memory is accessed with a different bus, meaning the central processing unit can fetch data and instructions at the same time. This also decreases the chance of a program corruption.<br />
<br />
Harvard Architecture is sometimes used within the central processing unit to handle its catches, but it is used less with main memory because of its complexity and cost.<br />
<br />
[[File:Harvard Architecture.jpg]]</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Data_Protection_Act&diff=1852Data Protection Act2017-03-06T10:17:26Z<p>Mfrederick: /* The Data Protection Act */</p>
<hr />
<div>== The Data Protection Act ==<br />
[[File:Lock.jpg|right|frame|x200px]]<br />
The data protection act is in place to protect peoples data which is stored on servers and on companies computers.<br />
<br />
The Data Protection Act states that:<br />
* If you collect data, you must not use it for a different reason.<br />
* You must not share data with external sources.<br />
* People have the right to see data about themselves.<br />
* You must not keep data for longer than you need to and it must be up-to-date.<br />
* You must not send data outside the European Economic Area (EEA) to an area with lower protection.<br />
* People who store data must be registered with the Information Commissioner’s Office (ICO).<br />
* If you store data, the data must be protected and safe.<br />
* If companies have information about you that is wrong, it is your right to as them to change it.</div>Mfrederickhttps://www.trccompsci.online/mediawiki/index.php?title=Data_Protection_Act&diff=1850Data Protection Act2017-03-06T10:17:17Z<p>Mfrederick: </p>
<hr />
<div>== The Data Protection Act ==<br />
<br />
The data protection act is in place to protect peoples data which is stored on servers and on companies computers.<br />
<br />
The Data Protection Act states that:<br />
* If you collect data, you must not use it for a different reason.<br />
* You must not share data with external sources.<br />
* People have the right to see data about themselves.<br />
* You must not keep data for longer than you need to and it must be up-to-date.<br />
* You must not send data outside the European Economic Area (EEA) to an area with lower protection.<br />
* People who store data must be registered with the Information Commissioner’s Office (ICO).<br />
* If you store data, the data must be protected and safe.<br />
* If companies have information about you that is wrong, it is your right to as them to change it.<br />
<br />
[[File:Lock.jpg|right|frame|x200px]]</div>Mfrederick