Skip to content
VUBuddy

CS301P Quiz 1

Data Structures (Practical) PDF 874 KBUpdated 23 Oct 2026
Quiz CS301P Quiz 1 PDF 874 KB
vubuddy.com
Type
Quiz
Course
CS301P Data Structures (Practical)
Size
PDF 874 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 874 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 1, 2 of 2. Download the file for all 2 pages.

Q1. In stack, which node will be considered as the Top of stack?

  1. Any node
  2. Last node
  3. Middle node
  4. First node

Correct answer: Last node

Q2. Which of the following is used to navigate from one node to another node in the linked list?

  1. Null pointer
  2. None of the given options
  3. Object field of node
  4. Next part of node

Correct answer: Next part of node

Q3. Each operator in a postfix expression refers to the previous _______ operand(s).

  1. 0
  2. 2
  3. 1
  4. 3

Correct answer: 2

Q4. How many times a for loop will be executed if we use the find() method of list data structure to find the value 10 from the given list?

  1. 5
  2. 10
  3. 7
  4. 4

Correct answer: 10

Q5. Which of the following statement declares an array ‘x’ with 6 integers?

  1. int x = 6;
  2. int [6] x;
  3. int x[6];
  4. float x[6];

Correct answer: int x[6];

Q6. Consider a list {2,6,8,7,1} represented as a linked list. In this list “current” is a:

  1. Head node
  2. Pointer
  3. List element
  4. List object

Correct answer: Head node

Q7. What does the following method do for a given linked list class? void traverse(List list) { Node* savedCurrentNode = list.currentNode; list.currentNode = list.headNode; for(int i = 1; list.next(); i++) {cout << "\n Element " << i << " " << list.get(); } list. currentNode = savedCurrentNode; }

  1. Adding new nodes
  2. Displaying the values of nodes
  3. Updating the values of nodes
  4. Deleting nodes

Correct answer: Displaying the values of nodes

Q8. What value will be returned by the given function if the values of ‘a’ and ‘b’ are 6 and 5? int i_avg (int a, int

  1. { return (a++ + ++b) / 2; }
  2. 6
  3. 5
  4. 4
  5. 7

Q9. In a doubly linked list, we can traverse the list in _______________.

  1. Forward direction
  2. Reverse direction
  3. No direction
  4. Both directions

Correct answer: Both directions

Q10. In C++, a single stack can be used for different types by using __________.

  1. Static variables
  2. Templates
  3. Postfix expressions
  4. Linked Lists

Correct answer: Templates

All CS301P files →
CS301P Data Structures (Practical) All CS301P 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.