CS-301 Final Term Exams Preparation Virtual University With Answers

CS-301 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 The arguments passed to a function should match in number, type and order with the parameters in the function definition. True False both
2 Merge sort makes two recursive calls,which statement is true after these recursive calls,finish but before the merge step? Elements in the first half of the array are less than or equal to elements in the second half of the array None of the given options The array elements form a heap. Elements in the second half of the array are less than or equal to elements in the first half of the array
3 The _______ method of list will position the currentNode and lastCurrentNode at the start of the list. Remove Next Start Back
4 What is the formula of approixation for the depth of a heap with n nodes? log (base 2) of n The number of digits in n (base 10 )e,g 145 has three digit The square root of n n
5 Which of the following is not true regarding the maze generation ? Randomly remove walls until the entrance and exit cells are in same set Removing a wall is the same as doing union of operation Removing a randomly chosen wall if the cell is separatedare already in the same set Do not remove a randomly chosen wall if the cells it separates are already in the same set.
6 Suppose you implement a Min heap (with the smallest element on top) in an array. Consider the different arrays below; determine the one that cannot possibly be a heap: 16, 18, 20, 22, 24, 28, 30 16, 20, 18, 24, 22, 30, 28 16, 24, 18, 28, 30, 20, 22 16, 24, 20, 30, 28, 18, 22
7 A binary tree with 33 internal nodes has _______ links to internal nodes. 31 32 33 66
8 Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this: 2 5 1 7 9 12 11 10 Which statement is correct? The pivot could be either the 7 or the 9 The pivot could be the 7, but it is not the 9. The pivot is not the 7, but it could be the 9. Neither the 7 nor the 9 is the pivot.
9 If both pointers of the node in a binary tree are NULL then it will be a/an _______ . Inner node Leaf node Root node None of the given options
10 If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is _______ . N N<sup>2</sup> Nlog<sub>2</sub>N log<sub>2</sub>N
Download This Set

Is this page helpful?