What components are graphs made up of?
Graphs are made of two components: nodes (or vertices) and edges.
What is a weighted graph?
A graph that has labels such as distance between nodes, as this ‘weights’ which option should be taken.
What’s an adjacency matrix?
A method for representing all the connection in a graph using a table with a one and a zero in the coordinate corresponding to each connection.
What’s an adjacency list?
A two column table with each node listed down the left column and each of its adjacent vertices listed in the right.
When should adjacency lists be used over adjacency matrixes?
When the graph is sparse i.e. there aren’t many connections between nodes and the connections are only one way. This is to efficiently use storage space.
What is a tree?
A connected, undirected graph with no cycles
What is a rooted tree?
A tree in which one vertex at the top is designated as the root and all other vertices connect to it
What is the explorers problem?
A route that traverses each edge once before returning to the start
What is the travellers problem?
A route that visits each vertex once before returning to the start
What is a parent node?
The node on a rooted tree from which the child node stems
What is a leaf node?
A node with no child nodes
What is a binary tree?
A rooted tree where each parent node can have at most two child nodes
What are the three types of tree traversals?
PreOrder
PostOrder
InOrder
How to carry out preOrder traversal?
Start from root node and go left when you are on the left of a node write it down
How do you carry out an inOrder traversal?
Start from root node and go left when you are on the base of a node write it down
How do you carry out a postOrder traversal?
Start from root node and go left when you are on the right of a node write it down
What is a good way of remembering the traversals?
preOrder - is on the left (before)
postOrder - is on the right (after)
inOrder - is in the middle