Main Data Structures Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Breadth First Traversal

A

The method of traversing a graph by using a queue to visit all of the neighbours of the current node before doing the same to each of the neighbours until the entire graph has been explored

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

Breadth Evaluation

A
  • More efficient when the data searched for is closer to the root
  • Better time complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Depth First Traversal

A

The method of traversing a graph by using a stack to travel as far along one route as possible and then backtracking and doing the same for the remaining routes until the entire graph has been explored

(Right side of the blocks) - Cheat code

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

Depth Evaluation

A
  • More efficient when the data searched for is further down
  • Can be written recursively to aid understanding
  • Memory requirement is linear
How well did you know this?
1
Not at all
2
3
4
5
Perfectly