Lec0309-traversals - Todays announcements MP4 available EC due 3/4 due 3/11 11:59p Today Trees-Complete tree

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
MP4 available, EC due 3/4, due 3/11, 11:59p. Today: Trees -------------------------- Complete tree: http://xlinux.nist.gov/dads//HTML/completeBinaryTree.html Today’s announcements:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Rooted, directed, ordered, binary trees Tree ADT: insert remove traverse template <class T> class tree{ public: private: struct treeNode{ T data; treeNode * left; treeNode * right; }; treeNode * root };
Background image of page 2
Theorem: if there are n data items in a binary tree, then there are ______ null pointers.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Traversal – scheme for visiting every node. • At each node, two choices for direction (left, right) • After both subtrees of a node are complete, move back up tree • Each node is “visited” 3 times in a traversal. • Each of those visit times corresponds to a particular kind of traversal. http://nova.umuc.edu/~jarc/idsv/lesson1.html
Background image of page 4
template<class T> void binaryTree<T>::_______Order(treeNode * croot){ if (croot != null){ ________Order(croot->left); ________Order(croot->right); } }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 12

Lec0309-traversals - Todays announcements MP4 available EC due 3/4 due 3/11 11:59p Today Trees-Complete tree

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online