Department

Electrical and Computer EngineeringCourse Code

ECE244H1Professor

Tarek AbdelrahmanChapter

19This

**preview**shows half of the first page. to view the full**2 pages of the document.** ECE244 Graphics

What’s the difference between binary tree and graph?

- Binary tree has root and graphs don’t

- Binary tree has at most two children and root can be in cycle (n children)

- Graphs may have non-connected subtree and binary tree don’t

Graph Traversal Order:

- Visit children before siblings (depth first traversal)

- Visit siblings before children (breadth first traversal)

- Visit adjacent nodes with smaller weights before ones with larger weights (best first

traversal)

Depth First Traversal → visit children before siblings

Breadth First Traversal → visit siblings before children

Which node should be the starting node?

- Usually the smallest node unless specify

What are “visit flag” use for in graphs?

###### You're Reading a Preview

Unlock to view full version