Design a binary tree, Data Structure & Algorithms

(a) Suppose that t is a binary tree of integers (that is, an object of type BinTree of Int.) in the state shown in Figure 3.

 

1533_Give the binary tree.png

Give the vectors returned by each of the following expressions.

(i) LEVEL_ORDER(t)

(ii) IN_ORDER(t.leftTree( ))

(b) suppose that v is an object of type VectorPlus of mString in the state ["tawny", "little", "barn", "long-eared", "eagle", "scops"]

In answering this part of the question you may, if you wish, use the WorkPad.

(i) Suppose that the strings in the vector v are rearranged into a sorted vector (where the strings in v arc compared using the lexicographic order described on page 32 of Unit 8). G i v e t h e vector that results from this rearrangement

(ii) Suppose that, the function GROW_TREE is applied to the sorted vector which you gave in part (i). Give the binary search tree which is returned by GROW_TREE.

(iii) Suppose that. The string "hawk" is inserted into the binary search tree which you gave in part (ii), using Strategy 3.2 of Unit 8. Give the resulting tree.

(c) The tree in Figure is a heap tree. Use Strategy 3.4 of Unit 8 to remove the root item from that tree. Give the binary tree produced by this strategy.

Posted Date: 3/7/2013 2:18:31 AM | Location : United States







Related Discussions:- Design a binary tree, Assignment Help, Ask Question on Design a binary tree, Get Answer, Expert's Help, Design a binary tree Discussions

Write discussion on Design a binary tree
Your posts are moderated
Related Questions
Q. Devise a representation for a given list where insertions and deletions can be made at both the ends. Such a structure is called Deque (which means Double ended queue). Write fu

In order to get the contents of a Binary search tree in ascending order, one has to traverse it in In-order

The best average behaviour is shown by  Quick Sort

How to creat ATM project by using double linked list?

(a) Describe the steps involved in the process of decision making under uncertainty. (b) Explain the following principles of decision making: (i) Laplace, (ii) Hurwicz. (c

Q. Write a procedure to the insert a node into the linked list at a particular position and draw the same by taking an example?

algorithm of output restricted queue.

Determine the Components of Illumination The light reaching the eye when looking at a surface has clearly come from a source (or sources) of illumination and bounced off the su

Simplifying Assumptions of wire frame representation Neglect colour - consider Intensity: For now we shall forget about colour and restrict our discussion just to the intensi

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4