Yr2 Graphs And Trees Flashcards

(17 cards)

1
Q

What components are graphs made up of?

A

Graphs are made of two components: nodes (or vertices) and edges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a weighted graph?

A

A graph that has labels such as distance between nodes, as this ‘weights’ which option should be taken.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s an adjacency matrix?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s an adjacency list?

A

A two column table with each node listed down the left column and each of its adjacent vertices listed in the right.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When should adjacency lists be used over adjacency matrixes?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a tree?

A

A connected, undirected graph with no cycles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a rooted tree?

A

A tree in which one vertex at the top is designated as the root and all other vertices connect to it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the explorers problem?

A

A route that traverses each edge once before returning to the start

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the travellers problem?

A

A route that visits each vertex once before returning to the start

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a parent node?

A

The node on a rooted tree from which the child node stems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a leaf node?

A

A node with no child nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a binary tree?

A

A rooted tree where each parent node can have at most two child nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the three types of tree traversals?

A

PreOrder
PostOrder
InOrder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to carry out preOrder traversal?

A

Start from root node and go left when you are on the left of a node write it down

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you carry out an inOrder traversal?

A

Start from root node and go left when you are on the base of a node write it down

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you carry out a postOrder traversal?

A

Start from root node and go left when you are on the right of a node write it down

17
Q

What is a good way of remembering the traversals?

A

preOrder - is on the left (before)
postOrder - is on the right (after)
inOrder - is in the middle