Explore BrainMass

Array-Based Tree, Heaps, Binary Files and Bit Sets

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Assume that v is an array-based tree with 70 members.

(a). Is v[45] a leaf node?
(b). What is the index of the first leaf node?
(c). What is the parent of v[50]?
(d). What are the children of v[10]?
(e). Does any item have exactly one child?
(f). What is the depth of the tree?
(g). How many leaf nodes does the tree have?

© BrainMass Inc. brainmass.com March 21, 2019, 6:51 pm ad1c9bdddf

Solution Preview

An array-based tree with 70 members has the following structure.
level 1: v[0]
level 2: v[1], v[2]
level 3: v[3], v[4], v[5], v[6]
level 4: v[7], v[8], v[9], v[10], v[11], v[12], v[13], ...

Solution Summary

Array-based tree, heaps, binary files and bit sets are examined.