Purchase Solution

Three questions about binary tree and heap

Not what you're looking for?

Ask Custom Question

I need help with the following in order to study for my test. The last time you were able to explain the lists so that I did well so I hope to be able to get the same results.

1.Show the order in which the nodes in the tree, which I included in the attachment are processed by
a. an inorder traversal of the tree.
b. a postorder traversal of the tree.
c. a preorder traversal of the tree.

2.A priority queue of strings is implemented using a heap. The heap contains the
following elements:
numElements [10]
.elements
[0]"introspective"
[1 ]"intelligent"
[2]"intellectual"
[3]"intimate"
[4]"intensive"
[5]"interesting"
[6]"internal"
[7]"into"
[8]"in"
[9]"intro"
a. What feature of these strings is used to determine their priority in the priority
queue?
b. Show how this priority queue is affected by adding the string "interviewing."

3.This is the specification of the directed graph
ZooGraph = (V, E)
V(ZooGraph) = {dog, cat, animal, vertebrate, oyster, shellfish, invertebrate, crab,
poodle, monkey, banana, dalmatian, dachshund}
E(ZooGraph) = {(vertebrate, animal), (invertebrate, animal), (dog, vertebrate),
(cat, vertebrate), (monkey, vertebrate), (shellfish, invertebrate),
(crab, shellfish), (oyster, shellfish), (poodle, dog), (dalmatian,
dog), (dachshund, dog)}
To tell if one element in ZooGraph has relation X to another element, you look
for a path between them. Show whether the following statements are true, using
the picture or adjacency matrix.
a. dalmatian X dog
b. dalmatian X vertebrate
c. dalmatian X poodle
d. banana X invertebrate
e. oyster X invertebrate
f. monkey X invertebrate

Attachments
Purchase this Solution

Solution Summary

The solution gives detailed steps on answering 3 questions regarding binary tree and heap.

Solution Preview

1
A. inorder traversal (we start from left then root then right)
11 22 23 29 30 47 49 56 59 61 62 64 69

B. postorder traversal (we start from left then right then root)
11 23 30 29 22 49 47 61 64 62 59 69 56

C. pre order traversal (we start from root then left then right)
56 47 22 11 29 23 30 49 69 59 62 61 64

2
A. The feature is that length of the string is used to determine their priority in the priority ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.