CS-301 Final Term Exams Preparation Virtual University With Answers

image
image
image

CS-301 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 Which of the following statement is NOT true about find operation : It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set. One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set. Initially each set contains one element. initially each set contains one element and it does not make sense to make a tree of one node only.
2 Which of the following statement is true about find(x) operation : A find(x) on element x is performed by returning exactly the same node that is found. A find(x) on element x is performed by returning the root of the tree containing x. A find(x) on element x is performed by returning TRUE. A find(x) on element x is performed by returning the whole tree itself containing x
3 Which of the following algorithm is most widely used due to its good average time Bubble sort insertion sort quick sort merge sort
4 Consider a min heap, represented by the following array: 3,4,6,7,5,10 After inserting a node with value 1.Which of the following is the updated min heap? 3,4,6,7,5,10,1 3,4,6,7,5,1,10 3,4,1,5,7,10,6 1,4,3,5,7,10,6close to correct but correct ans is 1,4,3,7,5,10,6
5 A complete binary tree of height 3 has between _____ node 8-14 8-15 8-16 8-17
6 By using _____ we avoid recursive method of traversing a tree,which makes use of stacks and consumes a lot of memory and time. Binary tree only Threaded binary tree Heap data structure Huffman encoding
7 If both pointers of the node in a binary trees are NULL then it will be a___ Inner node Leaf node Root node None of the above
8 Consider te following array 23 15 5 12 40 10 7 After the first pass of a particular algorithm, the array looks like 15 12 23 10 7 40 Name the algorithm used Heap sort Selection sort insertion sort Bubble sort
9 If there are N elements in an array then the number of maximum steps needed to find an elements using Binary Search is __________ N N<sup>2</sup> Nlog2N log<sub>2</sub>N
10 A binary tree of N nodes has _____ Log<sub>10</sub>N Levels Log<sub>2</sub> N levels N/2 Levels N X2 Levels
Download This Set