Previous Lecture Lecture 17 Next Lecture

Lecture 17, Tue 05/28

Trees, Priority Queues, Heaps

Plan for today

Tree Terms

Tree Properties

Binary Trees vs Binary Search Trees

Nodes and References

Map ADT

Tree Traversal Algorithms

The name of the traversal method tells you when the node that you are visiting should be printed:

Heap

By repeatedly removing the elements from a heap, we retreive them in sorted order.

Printing the values in a BST using inorder traversal, prints them in sorted order. Note: This is not the case for regular binary trees.