Main Data Structures 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
2
Q
Breadth Evaluation
A
- More efficient when the data searched for is closer to the root
- Better time complexity
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
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