Design a binary tree, Data Structure & Algorithms

Assignment Help:

(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.


Related Discussions:- Design a binary tree

What is binary space partition, Binary Space Partition A binary space-p...

Binary Space Partition A binary space-partitioning (BSP) tree is an efficient method for determining object visibility by painting surfaces onto the screen from back to front,

Explain thread, Thread By changing the NULL lines in a binary tree to ...

Thread By changing the NULL lines in a binary tree to special links known as threads, it is possible to perform traversal, insertion and deletion without using either a stack

Rooted tree, It does not have any cycles (circuits, or closed paths), which...

It does not have any cycles (circuits, or closed paths), which would imply the existence of more than one path among two nodes. It is the most general kind of tree, and might be co

Define merge sort, Define Merge Sort  Merge sort is a perfect example ...

Define Merge Sort  Merge sort is a perfect example of a successful application of the divide and conquer method. It sorts a given array A[0...n-l] by separating it into two ha

Execute algorithm to convert infix into post fix expression, Q. Execute you...

Q. Execute your algorithm to convert the infix expression to the post fix expression with the given infix expression as input Q = [(A + B)/(C + D) ↑ (E / F)]+ (G + H)/ I

The searching technique that takes o (1) time to find a data, The searching...

The searching technique that takes O (1) time to find a data is    Hashing is used to find a data

Bst created in pre- order, Q. Make a BST for the given sequence of numbe...

Q. Make a BST for the given sequence of numbers. 45,32,90,34,68,72,15,24,30,66,11,50,10 Traverse the BST formed in  Pre- order, Inorder and Postorder.

Deletion from a red-black tree, Deletion in a RBT uses two main processes, ...

Deletion in a RBT uses two main processes, namely, Procedure 1: This is utilized to delete an element in a given Red-Black Tree. It involves the method of deletion utilized in

Determine about the unreachable code assertion, Determine about the unreach...

Determine about the unreachable code assertion An unreachable code assertion is an assertion that is placed at a point in a program that shouldn't be executed under any circum

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd