CSE - Practice Test -16 | MyPerfectise Solutions

CoderIndeed
0
1) In which of the following tree, Parent node has a key value greater or equal to the key value of both its children?
Ans: Max-heap

2) Given the Pre order Traversal of a binary Search Tree, which of the following is the Post-order traversal of the tree?
Given pre order: 15, 6, 3, 2, 4, 7, 13, 9, 18, 17, 20
Ans: 2,4,3,9,13,7,6,17,20,18,15

3) While inserting the elements 30, 20, 60, 25, 50, 22, 15, 80, 90, 55, 45, 18, 10, 65, 85 in an empty Binary Search tree in the sequence above, the height of the Binary Search tree is:
(consider root node at level 0)
Ans: 4

4) A tree with n nodes will have how many edges?
Ans: n-1

5) What does the following Peace of code do?

Public void func (Tree root)
{
Func (root.key ());
Func (root.right ());
Printf ("% d” , root.data ());
{(code-box)
Ans: Post-order Traversal

6) An array consists of n elements. We want to create a heap using the elements. The time complexity building a heap will be in order of
Ans:   O(n log n)

7) A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below:
10, 8, 5, 3, 2
Two new elements ”1‘ and ”7‘ are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is :
Ans: 10,8,7,3,2,1,5

8) What is converse in-order of the Binary tree?\
Ans: DEABC

9) A BST (Binary Search Tree) is generated by inserting in order the following integers:
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24
The number of the nodes in the left sub tree & the right sub tree of the root respectively is:
Ans: (7,4)

10) Which type of traversal of BST(Binary Search tree) outputs the values in sorted order
Ans: In-order

11) X is a binary tree node given that X has two children. Let Y be In order successor of X. which is true about Y.
Ans: Y has no left child

12) The worst time to Perform Search operation on an BST
Ans:   O(n)

13) The value returned by foo when a pointer to the root of a binary tree is passed as its argument is
Ans: Diameter of the tree

14) The height of a BST is given as h. consider the height of the tree as the no. of edges in the longest Path from the root to leaf. The maximum no. of nodes possible in the tree is? Height of the root node is taken as O.
Ans: 2ℎ+1−1

15) Heap cap can be used as:
Ans: Priority Queue
(getCard) #type=(custom) #title=(CSE PlaceMe Answer Key) #info=(All Levels) #button=(View) #icon=(folder_open)

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !