Skip to content
VUBuddy

CS301 Midterm Solved MCQs with References Set 2 by Moaaz

Data Structures PDF 347 KBUpdated 23 Oct 2026
Midterm past paper CS301 Midterm Solved MCQs with References Set 2 by Moaaz PDF 347 KB
vubuddy.com
Type
Midterm past paper
Course
CS301 Data Structures
Size
PDF 347 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 347 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 2, 3, 4 of 23. Download the file for all 23 pages.

Spring 2010

Q1. (1 marks)

  1. False
  2. True (Page 101)

Correct answer: True (Page 101)

Q2. The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should (1 marks)

  1. Use better data structures
  2. Increase the hard disk space (Page 5)
  3. Use the better algorithm
  4. Use as much data as we can store on the hard disk

Correct answer: Increase the hard disk space (Page 5)

Q3. Consider the function X as under (1 marks)

int X (int& Value)

return Value;

Now a and b are integers in a calling function. Which one of the following is a valid call to the above function X.

  1. a = X (b) ;
  2. a = X (&b) ;
  3. a = X (*b) ;
  4. None of the given options

Correct answer: a = X (&b) ;

Here function argument passing by reference method is used, so when we call a function we will give the variable reference as parameter.

Q4. In the call by value methodology, a copy of the object is passed to the called function. (1 marks)

  1. False
  2. True (Page 202)

Correct answer: True (Page 202)

Q5. The tree data structure is a (1 marks)

  1. Linear data structure
  2. Non-linear data structure (Page 112)
  3. Graphical data structure
  4. Data structure like queue

Correct answer: Non-linear data structure (Page 112)

Q6. When should you use a const reference parameter? (1 marks)

  1. Whenever the parameter has huge size.
  2. Whenever the parameter has huge size, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument.
  3. Whenever the parameter has huge size, the function changes the parameter within its body, and you DO want these changes to alter the actual argument.
  4. Whenever the parameter has huge size, and the function does not change the parameter within its body.

Correct answer: Whenever the parameter has huge size, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument.

Declaring a parameter as a const simply means that the function can’t change the value of its parameters.

Q7. Here is the start of a C++ class declaration: (1 marks)

class foo

public: void x(foo f); void y(const foo f); void z(foo f) const;

Which of the three member functions can alter the PRIVATE member variables of the foo object that activates the function?

  1. Only x can alter the private member variables of the object that activates the function.
  2. Only y can alter the private member variables of the object that activates the function.
  3. Only z can alter the private member variables of the object that activates the function.
  4. Two of the functions can alter the private member variables of the object that activates the function.

Correct answer: Two of the functions can alter the private member variables of the object that activates the function.

Only the x and y can alter the private member variable of the foo class object. Last Option is more correct but not exact. In the last option the two function name are not mentioned

Q8. What is the maximum depth of recursive calls a function may make? (1 marks)

  1. 1
  2. 2
  3. n (where n is the argument)
  4. There is no fixed maximum

Correct answer: There is no fixed maximum

Q9. Suppose n is the number of nodes in a complete Binary Tree then maximum steps required for a search operation are, (1 marks)

  1. Log2 (n+1) -1 (Page 139)
  2. Log2 (n+1)
  3. Log2 (n) – 1
  4. Log2 (n)

Correct answer: Log2 (n+1) -1 (Page 139)

Q10. In the linked list implementation of the stack class, where does the push member function places the new entry on the linked list? (1 marks)

  1. At the head (Page 53)
  2. At the tail
  3. After all other entries that are greater than the new entry.
  4. After all other entries that are smaller than the new entry.

Correct answer: At the head (Page 53)

Q11. Suppose we have a circular array implementation of the queue class, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42, i.e., the array has been declared to be of size 42. Where does the push member function place the new entry in the array? (1 marks)

  1. data[1]
  2. data[2]
  3. data[11]
  4. data[12]

Correct answer: data[12]

Q12. The expression AB+C* is called? (1 marks)

  1. Prefix expression
  2. Postfix expression (Page 70)
  3. Infix expression
  4. None of these

Correct answer: Postfix expression (Page 70)

Q13. _________ 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? (1 marks)

  1. Strictly Binary Tree
  2. AVL tree
  3. All of these
All CS301 files →
CS301 Data Structures All CS301 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.