CS-301 Final Term Exams Preparation Virtual University With Answers

CS-301 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 In a perfectly balanced tree the insertion of a node needs ________ . One rotation Two rotations Rotations equal to number of levels No rotation at all
2 Consider te following array 23 15 5 12 40 10 7 After the first pass of a particular algorithm, the array looks like 15 5 12 23 10 7 40 Name the algorithm used Heap sort Selection sort Insertion sort Bubble sort (
3 There is/are ________ case/s for rotation in an AVL tree, 1 2 3 4
4 Which one is a self-referential data type? Stack Queue Link list All of these
5 If a max heap is implemented using a partially filled array called data, and the array contains n elements (n > 0), where is the entry with the greatest value? Data[0] data[1] data[n-1] data[n]
6 If a complete binary tree has height h then its no. of nodes will be, Log (h) 2<sup>h</sup>+1 - 1 Log (h) - 1 2<sup>h</sup> - 1
7 If you know the size of the data structure in advance, i.e., at compile time, which one of the following is a good data structure to use. Array List Both None of the above
8 Each node in a double link list has , 1 pointer 2 pointer 3 pointer 4 pointers
9 A binary tree with N internal nodes has ____ links ,links to internal node and ____links to external N+1, 2N, N-1 N+1, N-1, 2N 2N, N-1, N+1 N-1, 2N, N+1
10 Here is a small function definition: void f(int i, int &k) { i = 1; k = 2; } Suppose that a main program has two integer variables x and y, which are given the value 0. Then the main program calls f(x,y); What are the values of x and y after the function f finishes? Both x and y are still 0. x is now 1 but y is still 0 x is still 0,but y is now 2 x is now1 1 and y is now 2
Download This Set

Is this page helpful?