23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

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

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

For source code <strong>and</strong> help with exercises, please visit<br />

java.datastructures.net.<br />

Re<strong>in</strong>forcement<br />

R-7.1<br />

The follow<strong>in</strong>g questions refer to the tree of Figure 7.3.<br />

a.<br />

Which node is the root?<br />

b.<br />

What are the <strong>in</strong>ternal nodes?<br />

c.<br />

How many descendents does node cs016/ have?<br />

d.<br />

How many ancestors does node cs016/ have?<br />

e.<br />

What are the sibl<strong>in</strong>gs of node homeworks/?<br />

f.<br />

Which nodes are <strong>in</strong> the subtree rooted at node projects/?<br />

g.<br />

What is the depth of node papers/?<br />

h.<br />

R-7.2<br />

What is the height of the tree?<br />

F<strong>in</strong>d the value of the arithmetic expression associated with each subtree of the<br />

b<strong>in</strong>ary tree of Figure 7.11.<br />

R-7.3<br />

432

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

Saved successfully!

Ooh no, something went wrong!