Skip to main content

Introduction To Data Structures — Part 2 MCQs with Explanations

Practice high-yield Computer Science & IT MCQs on Introduction To Data Structures — Part 2 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ PPSC ★ FPSC

Which of the following data structures can be used to implement a deque?

Question 2 of 40
★ PPSC ★ FPSC

What is the primary characteristic of a stack?

Question 3 of 40
★ PPSC ★ FPSC

What is the average-case time complexity of binary search?

Question 4 of 40
★ PPSC ★ FPSC

Which of the following data structures does not allow duplicates?

Question 5 of 40
★ PPSC ★ FPSC

Which of the following is a disadvantage of an array over a linked list?

Question 6 of 40
★ PPSC ★ FPSC

Which data structure is used to check for balanced parentheses in an expression?

Question 7 of 40
★ PPSC ★ FPSC

Which of the following is not an application of priority queue?

Question 8 of 40
★ PPSC ★ FPSC

Making the push operation costly, select the code snippet which implements the pop operation.

Question 9 of 40
★ PPSC ★ FPSC

What does the following Java code do? public Object function() { if(isEmpty()) return -999; else { Object high; high = q[front]; return high; } }

Question 10 of 40
★ PPSC ★ FPSC

What is not a disadvantage of priority scheduling in operating systems?

Question 11 of 40
★ PPSC ★ FPSC

What is a dequeue?

Question 12 of 40
★ PPSC ★ FPSC

Entries in a stack are "ordered". What is the meaning of this statement?

Question 13 of 40
★ PPSC ★ FPSC

In linked list implementation of a queue, from where is the item deleted?

Question 14 of 40
★ PPSC ★ FPSC

What is the space complexity for deleting a linked list?

Question 15 of 40
★ PPSC ★ FPSC

Which of the following is not the type of queue?

Question 16 of 40
★ PPSC ★ FPSC

What is the functionality of the following piece of code? public Object delete_key() { if(count == 0) { System.out.println("Q is empty"); System.exit(0); } else { Node cur = head.getNext(); Node dup = cur.getNext(); Object e = cur.getEle(); head.setNext(dup); count--; return e; } }

Question 17 of 40
★ PPSC ★ FPSC

Consider a small circular linked list. How to detect the presence of cycles in this list effectively?

Question 18 of 40
★ PPSC ★ FPSC

If the elements "A", "B", "C" and "D" are placed in a stack and are deleted one at a time, what is the order of removal?

Question 19 of 40
★ PPSC ★ FPSC

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?

Question 20 of 40
★ PPSC ★ FPSC

What kind of linked list is best to answer questions like "What is the item at position n?"

Question 21 of 40
★ PPSC ★ FPSC

What is the time complexity of inserting at the end in dynamic arrays?

Question 22 of 40
★ PPSC ★ FPSC

Which of the following is not an advantage of a priority queue?

Question 23 of 40
★ PPSC ★ FPSC

You have two jars, one jar which has 10 rings and the other has none. They are placed one above the other. You want to remove the last ring in the jar. And the second jar is weak and cannot be used to store rings for a long time.

Question 24 of 40
★ PPSC ★ FPSC

The essential condition which is checked before deletion in a linked queue is?

Question 25 of 40
★ PPSC ★ FPSC

If the elements "A", "B", "C" and "D" are placed in a queue and are deleted one at a time, in what order will they be removed?

Question 26 of 40
★ PPSC ★ FPSC

You are asked to perform a queue operation using a stack. Assume the size of the stack is some value 'n' and there are 'm' number of variables in this stack. The time complexity of performing deQueue operation is (Using only stack operations like push and pop)(Tightly bound).

Question 27 of 40
★ PPSC ★ FPSC

Linked list data structure offers considerable saving in . . . . . . . .

Question 28 of 40
★ PPSC ★ FPSC

Consider these functions: push() : push an element into the stack pop() : pop the top-of-the-stack element top() : returns the item stored in top-of-the-stack-node What will be the output after performing these sequence of operations. push(20); push(4); top(); pop(); pop(); push(5); top();

Question 29 of 40
★ PPSC ★ FPSC

What is the space complexity of a linear queue having n elements?

Question 30 of 40
★ PPSC ★ FPSC

What is the functionality of the following piece of code? public int function(int data) { Node temp = head; int var = 0; while(temp != null) { if(temp.getData() == data) { return var; } var = var+1; temp = temp.getNext(); } return Integer.MIN_VALUE; }

Question 31 of 40
★ PPSC ★ FPSC

What is the time complexity of enqueue operation?

Question 32 of 40
★ PPSC ★ FPSC

What is the functionality of the following piece of Java code? Assume: 'a' is a non empty array of integers, the Stack class creates an array of specified size and provides a top pointer indicating TOS(top of stack), push and pop have normal meaning. public void some_function(int[] a) { Stack S=new Stack(a.length); int[] b=new int[a.length]; for(int i=0;i<a.length;i++) { S.push(a[i]); } for(int i=0;i<a.length;i++) { b[i]=(int)(S.pop()); } System.out.println("output :"); for(int i=0;i<b.length;i++) { System.out.println(b[i]); } }

Question 33 of 40
★ PPSC ★ FPSC

Select the code snippet which return true if the stack is empty, false otherwise.

Question 34 of 40
★ PPSC ★ FPSC

What is the time complexity to insert a node based on key in a priority queue?

Question 35 of 40
★ PPSC ★ FPSC

What happens when you pop from an empty stack while implementing using the Stack ADT in Java?

Question 36 of 40
★ PPSC ★ FPSC

What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?

Question 37 of 40
★ PPSC ★ FPSC

The data structure required to check whether an expression contains a balanced parenthesis is?

Question 38 of 40
★ PPSC ★ FPSC

Which of these best describes an array?

Question 39 of 40
★ PPSC ★ FPSC

Given only a single array of size 10 and no other memory is available. Which of the following operation is not feasible to implement (Given only push and pop operation)?

Question 40 of 40
★ PPSC ★ FPSC

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is?

✓ Link copied to clipboard
Continue Your Practice

Advanced Mapreduce Concepts — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Computer Science & IT

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Computer Science & IT

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →