VU Midterm Past Papers
200 solved midterm 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 midterm handout.
Q1. If there is a strictly complete binary tree of depth 3, the total number of nodes in it will be?
Q2. Which of the following is TRUE for search operations in a binary tree as compared to linked list or an array?
Q3. Elements in a queue data structure are added from______ and removed from--------?
Q4. Function signatures are also called:
Q5. In a tree, we link the nodes in such a way that it ___________ a linear structure.
Q6. Which of the following traversal method traverses the binary tree in sorted order?
Q7. In which traversal method, the recursive calls can be used to traverse a binary tree?
Q8. If we return the reference of a local variable from a function it will cause:
Q9. While implementing non-recursive traversal for Binary Search Tree, we need to implement _________.
Q10. When a function calling itself is called as __________.
Q11. In the perspective of memory organization each process is divided into -------sections.
Q12. In a program a reference variable with name "x" can be declared as
Q13. A binary tree is said to be a _____ binary tree if every non-leaf node in a binary tree has non-empty left and right subtrees.
Q14. We can calculate the ___________ of a subtree by counting its levels from the bottom.
Q15. In C++, we place the class interface in __________file.
Q16. In which traversal method root node is visited at last step?
Q17. Which one is the correct function call for the following function of calculating cube?
Q18. The balance of a node in a binary tree is defined as the height of its -----sub tree minus height of its right sub tree.
Q19. In level-order traversal for Binary Search Tree, at each level, we visit the nodes in------order.
Q20. In level-order traversal for Binary Search Tree, __________ data structure is used.
Q21. For a complete binary tree with n numbers of nodes, the depth is calculated as ____________
Q22. A __________ is a tree in which every level, except possibly the last, is completely filled.
Q23. In a complete binary tree, for 25000 nodes the depth will be-----
Q24. Left, right, info, and parent are the operations of _________ data structure.
Q25. If both left and right nodes of a node are NULL then this type of node is called a ------node.
Q26. ------- is used for Reference variables in C++.
Q27. Local variables defined inside function body are ___________ automatically at the end of function execution.
Q28. The process of getting the value of a variable using pointers is called:
Q29. We allocate memory dynamically by using _______ operator.
Q30. For searching a particular number in Binary Search Tree (if it is not present), the maximum number of comparisons will be _______ comparison(s) at each level.
Q31. In a complete binary tree the number of nodes at level 5 are
Q32. The _________ of a binary tree is the maximum level of its leaves (also called the depth).
Q33. When a function calls another function, the parameters and return address of the calling function are put in ________.
Q34. If a function has recursive call as the last statement, it is known as __?
Q35. Following is a keyword of C++ ____________
Q36. BinarySearchTree () is-----------------------?
Q37. Sub-tree of binary search tree should be ________.
Q38. Josephus problem is resolved by the implementation of____________.
Q39. In which of the following tree for each node, the value of root node is greater than left child and smaller than right child ?
Q40. If the root of a tree is at level zero, its two children (subtrees) i.e. nodes will be at ________
Q41. The abstract data type refers to the basic mathematical concept that defines the
Q42. If we use singly linked list to implement list, then there is an issue that it gives difficulty when we:
Q43. In a list, tail() method of current pointer _____________
Q44. The -- is a decrement operator in C++ that decreases the value of the operand by _______.
Q45. Two common models of simulation are _____________ and ______________.
Q46. For searching a particular number in Binary Search Tree (if it is not present), the maximum number of comparisons will be _______ comparison at each level.
Q47. Which of the following is known as "Last-In, First-Out" or LIFO Data Structure?
Q48. When add() operation of a linked list is called the following action is done
Q49. What will be the postfix expression of following infix expression?A*B/C+D-E
Q50. In Left-Right case of rotation in ________ tree. A double rotation is performed.
Q51. Local variables of a function are stored in,
Q52. The _______of every node should be 1, 0 or -1 otherwise, it will not be an AVL tree.
Q53. Stack and Queue can be implemented using _________,
Q54. What will be postfix expression of the following infix expression?Infix Expression :a+b*c-d
Q55. Suppose we have the following values to be inserted in constructing AVL tree,10,13,15,5,7,8 Tell when first rotation will take place,
Q56. _______________ parameter passing (by value or by reference) is similar to PASCAL.
Q57. _____ method returns the top element of the stack without removing it.
Q58. In tree, the search operation is _________ as compared to the linked list.
Q59. Suppose we have a value for Queue: 2 1 4 6 3Where front is at 2 and rear is at 3, after dequeue one element from that Queue, what will be the resultant Queue?
Q60. The computer memory can be thought of as a/an
Q61. In________, a programmer uses two pointers in the node, i.e. one to point to next node and the other to point to the previous node.
Q62. A queue is a data structure where elements are
Q63. The stack implementing an array causes worst case behavior when the insertion and deletion of an element done from
Q64. In AVL tree during insertion, a single rotation can fix the balance in cases _________ and 4.
Q65. If a node is inserted in outer side of a node in binary search tree then to make it AVL tree,
Q66. A zigzag rotation is performed. In Left-Left case of rotation in AVL tree.
Q67. The principal benefit of a linked list over a conventional array is that the order of the linked items may be_______ from the order that the data items are stored in memory.
Q68. Stack.push(15) will push 15 on _________.
Q69. All the objects created using ___________ operator have to be explicitly destroyed using the delete operator.
Q70. Suppose you are writing a class for Node class and forgot to write the constructor of the class, then
Q71. _________ is the maximum height of the AVL tree.
Q72. length() method of List class is used to:
Q73. There are four cases of rotation in an __________ tree.
Q74. ________ is utilized at the time of memory allocation in dynamic manner.
Q75. In which case of insertion we require double rotation to make the AVL tree balance.
Q76. The back() method decreases the value of variable current by __________.
Q77. In array list the worst case of removing an element is
Q78. Which of the following is a correct statement?
Q79. Whenever we call a function, the compiler makes a stack, the top element of the stack is _______ of the function.
Q80. Whenever we call a function, the compiler makes a _________ that it uses to fulfill this function call.
Q81. _______ is the major factor to see the efficiency of a program.
Q82. __________ rule applies for evaluating operators of same precedence in an expression
Q83. The postfix form of the expression A + B * C and (A + B) * C will be _______.
Q84. If we use array to implement list, then there is an issue that it gives difficulty when:
Q85. During in-order traversal using recursive calls, if we found a node is NULL. It means this node will satisfy following condition.
Q86. Which one the following is more closer to AVL tree, (chose the best option)
Q87. start() method of List class is used to:
Q88. Consider the following infix expression. 7/8 + 9 If one converts the above expression into postfix, what would be the resultant expression?
Q89. In internal memory organization of a process, there is some area of memory for static data that holds ____________ variables.
Q90. If numbers 5, 222, 4, 48 are inserted in a queue, which one will be removed first?
Q91. Each node in singly linked list contains______
Q92. What's wrong with following loop? while( (i< 10) && (i> 24)) { }
Q93. Which one of the following statement is NOT correct .
Q94. Each operator in a postfix expression refers to the previous ________ operand(s).
Q95. Which one of the following calling methods does not change the original value of the argument in the calling function?
Q96. 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?
Q97. Which one is a self- referential data type?
Q98. Each node in doubly link list has,
Q99. 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?
Q100. Consider the following tree. How many of the nodes have at least one sibling?
Q101. The nodes with no successor are called _________
Q102. 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?
Q103. Suppose a pointer has been declared in main but has not assigned any variable address then
Q104. Which statement of the following statements is incorrect?
Q105. Parameters in function call are passed using,
Q106. What is the maximum depth of recursive calls a function may make?
Q107. Queue follows,
Q108. _________ is a binary tree where every node has a value, every node's left subtree contains only values less than or equal to the node's value, and every node's right subtree contains only values that are greater then or equal ?
Q109. Four statements about trees are below. Three of them are correct. Which one is INCORRECT?
Q110. Below is a binary search tree. If we delete the value 50 using the algorithm we discussed, what value will be in the root of the remaining tree?
Q111. _________ is a data structure that can grow easily dynamically at run time without having to copy existing elements.
Q112. Suppose there are 100 elements in an equivalence classes so initially there will be 100 tree.The collection of tree is called_
Q113. For a perfect binary tree of height h, having N nodes the sum of height of nodes is
Q114. Sorting procedure normally takes ______time
Q115. there are 100 elements in an equivalence classes then will have ______state initially
Q116. ________ objects (objects accessed by pointers) are called anonymous objects.
Q117. ___________ is a self-balancing tree.
Q118. Which of the following operation returns but do not removes top value of the stack?
Q119. Int htdiff = height(root->getLeft()) __________ height(root->getRight()); The above line of code is taken from AVL insert method. Complete it by selecting an appropriate symbol.
Q120. Which operation of the queue data structure is used to insert an element into the Queue?
Showing the first 120 of 200 MCQs.