12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sec. 6.7 Exercises 229CAFBEHGDIFigure 6.18 A sample tree for Exercise 6.16.6.17 Draw the binary tree representing the following sequential representation forbinary trees illustrated by Example 6.5:ABD//E//C/F//6.18 Draw the binary tree representing the following sequential representation forbinary trees illustrated by Example 6.6:A ′ /B ′ /C ′ D ′ G/EShow the bit vec<strong>to</strong>r for leaf <strong>and</strong> internal nodes (as illustrated by Example 6.7)for this tree.6.19 Draw the general tree represented by the following sequential representationfor general trees illustrated by Example 6.8:XPC)Q)RV)M))))6.20 (a) Write a function <strong>to</strong> decode the sequential representation for binary treesillustrated by Example 6.5. The input should be the sequential representation<strong>and</strong> the output should be a pointer <strong>to</strong> the root of the resultingbinary tree.(b) Write a function <strong>to</strong> decode the sequential representation for full binarytrees illustrated by Example 6.6. The input should be the sequentialrepresentation <strong>and</strong> the output should be a pointer <strong>to</strong> the root of the resultingbinary tree.(c) Write a function <strong>to</strong> decode the sequential representation for generaltrees illustrated by Example 6.8. The input should be the sequentialrepresentation <strong>and</strong> the output should be a pointer <strong>to</strong> the root of the resultinggeneral tree.6.21 Devise a sequential representation for Huffman coding trees suitable for useas part of a file compression utility (see Project 5.7).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!