VU Final Term Past Papers
213 solved final term past paper MCQs for CS301 (Data Structures) at Virtual University, each with the correct answer marked. Use them to learn the VU question style and test your recall. An independent study tool — not affiliated with VU.
Prefer a summary first? Read the CS301 final term handout.
Q1. A solution is said to be efficient if it solves the problem within its resource constraints i.e. hardware and time.
Q2. Which one of the following is known as "Last-In, First-Out" or LIFO Data Structure?
Q3. What will be postfix expression of the following infix expression? Infix Expression : a + b*c-d
Q4. For compiler a postfix expression is easier to evaluate than infix expression?
Q5. If there are N external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
Q6. If there are N internal nodes in a binary tree then what will be the no. of external nodes in this binary tree?
Q7. If we have 1000 sets each containing a single different person. Which of the following relation will be true on each set:
Q8. Which one of the following is NOT the property of equivalence relation:
Q9. A binary tree of N nodes has _______.
Q10. The easiest case of deleting a node from BST is the case in which the node to be deleted ___________.
Q11. If there are N elements in an array then the number of maximum steps needed to find an element using Binary Search is _______ .
Q12. Merge sort and quick sort both fall into the same category of sorting algorithms. What is this category?
Q13. If one pointer of the node in a binary tree is NULL then it will be a/an _______ .
Q14. We convert the ________ pointers of binary to threads in threaded binary tree.
Q15. If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a
Q16. What is the best definition of a collision in a hash table?
Q17. Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again )
Q18. 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:
Q19. Do you see any problem in the code of nextInOrder below: TreeNode * nextInorder(TreeNode * p) { if(p->RTH == thread) return( p->R ); else { p = p->R; while(p->LTH == child) p = p->R; return p; } }
Q20. Which of the following statement is correct about find(x) operation:
Q21. Which of the following statement is NOT correct about find operation:
Q22. In complete binary tree the bottom level is filled from ________
Q23. Here is an array of ten integers: 5 3 8 9 1 7 0 2 6 4 The array after the FIRST iteration of the large loop in a selection sort (sorting from smallest to largest).
Q24. What requirement is placed on an array, so that binary search may be used to locate an entry?
Q25. Which one of the following operations returns top value of the stack?
Q26. Compiler uses which one of the following in Function calls,
Q27. Every AVL is _________________
Q28. If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
Q29. If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
Q30. Which one of the following is not an example of equivalence relation?
Q31. Binary Search is an algorithm of searching, used with the ______ data.
Q32. Which one of the following is NOT true regarding the skip list?
Q33. A simple sorting algorithm like selection sort or bubble sort has a worst-case of
Q34. Which of the following is a property of binary tree?
Q35. By using __________we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
Q36. Which of the following statement is true about dummy node of threaded binary tree?
Q37. For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
Q38. Which formula is the best approximation for the depth of a heap with n nodes?
Q39. Which of the following is not true regarding the maze generation?
Q40. In threaded binary tree the NULL pointers are replaced by ,
Q41. Which of the given option is NOT a factor in Union by Size:
Q42. Suppose we had a hash table whose hash function is “n % 12”, if the number 35 is already in the hash table, Which of the following numbers would cause a collision?
Q43. A binary tree with 24 internal nodes has ______ external nodes.
Q44. In case of deleting a node from AVL tree, rotation could be prolong to the root node.
Q45. _______ is the stack characteristic but _______was implemented because of the size limitation of the array.
Q46. What kind of list is best to answer questions such as "What is the item at position n?"
Q47. Each node in doubly link list has,
Q48. A binary tree with N internal nodes has _____ links, _______ links to internal nodes and ________ links to external nodes
Q49. The definition of Transitivity property is
Q50. Union is a _______ time operation.
Q51. Huffman encoding uses _________ tree to develop codes of varying lengths for the letters used in the original message.
Q52. Consider a min heap, represented by the following array: 10,30,20,70,40,50,80,60 After inserting a node with value 31.Which of the following is the updated min heap?
Q53. Consider a min heap, represented by the following array: 11,22,33,44,55 After inserting a node with value 66.Which of the following is the updated min heap?
Q54. _________ is a data structure that can grow easily dynamically at run time without having to copy existing elements.
Q55. The maximum number of external nodes (leaves) for a binary tree of height H is _________
Q56. A complete binary tree of height ____ has nodes between 16 to 31 .
Q57. Suppose A is an array containing numbers in increasing order, but some numbers occur more than once when using a binary search for a value, the binary search always finds ____________
Q58. “+” is a _________operator.
Q59. A kind of expressions where the operator is present between two operands called ________expressions.
Q60. 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?
Q61. 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.
Q62. If a complete binary tree has height h then its no. of nodes will be,
Q63. 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?
Q64. Which one is a self-referential data type?
Q65. There is/are ________ case/s for rotation in an AVL tree,
Q66. Which of the following can be the inclusion criteria for pixels in image segmentation.
Q67. 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
Q68. In a perfectly balanced tree the insertion of a node needs ________ .
Q69. Which of the following is NOT a correct statement about Table ADT.
Q70. If both pointers of the node in a binary tree are NULL then it will be a/an _______ .
Q71. 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?
Q72. A binary tree with 33 internal nodes has _______ links to internal nodes.
Q73. The _______ method of list will position the currentNode and lastCurrentNode at the start of the list.
Q74. Mergesort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?
Q75. The arguments passed to a function should match in number, type and order with the parameters in the function definition.
Q76. If numbers 5, 222, 4, 48 are inserted in a queue, which one will be removed first?
Q77. Suppose currentNode refers to a node in a linked list (using the Node class with member variables called data and nextNode). What statement changes currentNode so that it refers to the next node?
Q78. A Compound Data Structure is the data structure which can have multiple data items of same type or of different types. Which of the following can be considered compound data structure?
Q79. The difference between a binary tree and a binary search tree is that ,
Q80. Compiler uses which one of the following to evaluate a mathematical equation,
Q81. Which of the following method is helpful in creating the heap at once?
Q82. A complete binary tree of height 3 has between ________ nodes.
Q83. 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?
Q84. Which one of the following algorithms is most widely used due to its good average time,
Q85. We are given N items to build a heap, this can be done with _____ successive inserts.
Q86. __________ only removes items in reverse order as they were entered.
Q87. Select the one FALSE statement about binary trees:
Q88. Searching an element in an AVL tree take maximum _______ time (where n is no. of nodes in AVL tree),
Q89. Suppose you implement a heap (with the largest element on top) in an array. Consider the different arrays below, determine the one that cannot possibly be a heap:
Q90. In the worst case of deletion in AVL tree requires _________.
Q91. Which of the following statement is NOT true about threaded binary tree?
Q92. Consider a min heap, represented by the following array: 3,4,6,7,5 After calling the function deleteMin.Which of the following is the updated min heap?
Q93. We can build a heap in ________ time.
Q94. While joining nodes in the building of Huffman encoding tree if there are more nodes with same frequency, we choose the nodes _______.
Q95. Consider the following paragraph with blanks. A ... is a linear list where and take place at the same end . This end is called the . What would be the correct filling the above blank positions?
Q96. Which traversal gives a decreasing order of elements in a heap where the max element is stored at the top?
Q97. Which of the following is a non linear data structure?
Q98. The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should
Q99. In an array list the current element is
Q100. Which one of the following is a valid postfix expression?
Q101. In sequential access data structure, accessing any element in the data structure takes different amount of time. Tell which one of the following is sequential access data structure,
Q102. I have implemented the queue with a circular array. If data is a circular array of CAPACITY elements, and last is an index into that array, what is the formula for the index after last?
Q103. Which one of the following is TRUE about recursion?
Q104. Which of the following heap method increase the value of key at position „p‟ by the amount „delta‟?
Q105. Which of the following statements is correct property of binary trees?
Q106. In a selection sort of n elements, how many times the swap function is called to complete the execution of the algorithm?
Q107. Consider the following postfix expression S and the initial values of the variables. S=AB-C+DEF-+^ Assume that A=3, B=2, C=1, D=1, E=2, F=3 What would be the final output of the stack?
Q108. In a min heap , preculateDown procedure will move smaller value______ and bigger value______.
Q109. Which of the following statement is correct about union:
Q110. Let heap stored in an array as H = [50, 40, 37, 32, 28, 22, 36, 13]. In other words, the root of the heap contains the maximum element. What is the result of deleting 40 from this heap
Q111. In an array we can store data elements of different types.
Q112. Which one of the following statement is NOT correct .
Q113. Doubly Linked List always has one NULL pointer.
Q114. A queue is a data structure where elements are,
Q115. I have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. Which of these pointers will change during an insertion into an EMPTY queue?
Q116. Use of binary tree in compression of data is known as _______ .
Q117. While building Huffman encoding tree the new node that is the result of joining two nodes has the frequency.
Q118. A Threaded Binary Tree is a binary tree in which every node that does not have a right child has a THREAD to its __________ successor.
Q119. A complete binary tree is a tree that is _________ filled, with the possible exception of the bottom level.
Q120. Consider the following infix expression: x–y*a+b/c Which of the following is a correct equivalent expression(s) for the above?
Showing the first 120 of 213 MCQs.