lecture-14

Visit the root c of the right subtree of b cpsc 223

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: SC 223  ­ ­ Fall 2010 17 Depth-First, Left-to-Right Tree Traversal previous subtree previous subtree A D B G current subtree C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 8. Traverse to the right subtree of B CPSC 223  ­ ­ Fall 2010 18 9 10/19/10 Depth-First, Left-to-Right Tree Traversal previous subtree previous subtree D B A G current subtree C E NULL NULL NULL NULL NULL H F NULL NULL NULL NULL 9. Visit the root C of the right subtree of B CPSC 223  ­ ­ Fall 2010 19 Depth-First, Left-to-Right Tree Traversal previous subtree current subtree A D B G previous subtree C E NULL NULL NULL NULL NULL H F NULL NULL current subtree NULL NULL 10. Traverse to the le/ subtree of C –  The subtree is empty, so nothing to visit –  We’re done going right … CPSC 223  ­ ­ Fall 2010 20 10 10/19/10 Depth-First, Left-to-Right Tree Traversal previous subtree current subtree D B A G previous subtree C E NULL NULL NULL NULL NULL H F NULL NULL current subtree NULL NULL 11. Traverse to the right subtree of C –  The subtree is empt...
View Full Document

Ask a homework question - tutors are online