trees and algorithms Flashcards
1
Q
define a tree
A
a graph where nodes are undirected and do not loop
2
Q
what data structure would you use for a breadth first search
A
queue
3
Q
describe djikstras algorithm
A
visit all nodes, starting with shortest range, update the shortest distance to the current node based on shortest distance so far, making sure nodes are visited once complete. then work backwards to confirm shortest path.