lecture-14

Visit the root d of the sub tree cpsc 223 fall 2010 10

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: his means visit the root node first –  Once visited, traverse le< and then traverse right CPSC 223  ­ ­ Fall 2010 9 Depth-First, Left-to-Right Tree Traversal current subtree D B A G C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 1. Visit the root D of the (sub) tree CPSC 223  ­ ­ Fall 2010 10 5 10/19/10 Depth-First, Left-to-Right Tree Traversal previous subtree current subtree D B A G C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 2. Traverse to the le/ subtree of D CPSC 223  ­ ­ Fall 2010 11 Depth-First, Left-to-Right Tree Traversal previous subtree current subtree A D B G C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 3. Visit the root B of the le< subtree of D CPSC 223  ­ ­ Fall 2010 12 6 10/19/10 Depth-First, Left-to-Right Tree Traversal previous subtree previous subtree current subtree D B A G C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 4. Traverse to the le/ subtree of B CPSC 223  ­ ­ Fall 2010 13 Depth-First, Left-to-Right Tree Traversal previous subtree previous subtree current subtree A D B G C E NULL NULL N...
View Full Document

Ask a homework question - tutors are online