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
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following data structures can be used to implement a deque?
Correct Answer: Option D — Linked List
Detailed Academic Explanation:
Linked List is the correct answer to “Which of the following data structures can be used to implement a deque”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the primary characteristic of a stack?
Correct Answer: Option B — LIFO
Detailed Academic Explanation:
LIFO is the correct answer to “What is the primary characteristic of a stack”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the average-case time complexity of binary search?
Correct Answer: Option B — O(log n)
Detailed Academic Explanation:
O(log n) is the correct answer to “What is the average-case time complexity of binary search”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following data structures does not allow duplicates?
Correct Answer: Option B — Set
Detailed Academic Explanation:
Set is the correct answer to “Which of the following data structures does not allow duplicates”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is a disadvantage of an array over a linked list?
Correct Answer: Option A — Fixed size
Detailed Academic Explanation:
Fixed size is the correct answer to “Which of the following is a disadvantage of an array over a linked list”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which data structure is used to check for balanced parentheses in an expression?
Correct Answer: Option A — Stack
Detailed Academic Explanation:
Stack is the correct answer to “Which data structure is used to check for balanced parentheses in an expression”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is not an application of priority queue?
Correct Answer: Option C — Undo operation in text editors
Detailed Academic Explanation:
Undo operation in text editors is the correct answer to “Which of the following is not an application of priority queue”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Making the push operation costly, select the code snippet which implements the pop operation.
Correct Answer: Option B — public void pop() { if(q1.size()>0) { q1.poll(); } else if(q2.size()>0) { q2.poll(); } }
Detailed Academic Explanation:
public void pop() { if(q1.size()>0) { q1.poll(); } else if(q2.size()>0) { q2.poll(); } } is the correct answer to “Making the push operation costly, select the code snippet which implements the pop operation.”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What does the following Java code do? public Object function() { if(isEmpty()) return -999; else { Object high; high = q[front]; return high; } }
Correct Answer: Option C — Return the front element
Detailed Academic Explanation:
Return the front element is the correct answer to “What does the following Java code do? public Object function() { if(isEmpty()) return -999; else { Object high; high = q[front]; return high; } }”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is not a disadvantage of priority scheduling in operating systems?
Correct Answer: Option C — Interrupt handling
Detailed Academic Explanation:
Interrupt handling is the correct answer to “What is not a disadvantage of priority scheduling in operating systems”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is a dequeue?
Correct Answer: Option A — A queue with insert/delete defined for both front and rear ends of the queue
Detailed Academic Explanation:
A queue with insert/delete defined for both front and rear ends of the queue is the correct answer to “What is a dequeue”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Entries in a stack are "ordered". What is the meaning of this statement?
Correct Answer: Option D — There is a Sequential entry that is one by one
Detailed Academic Explanation:
There is a Sequential entry that is one by one is the correct answer to “Entries in a stack are "ordered". What is the meaning of this statement”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In linked list implementation of a queue, from where is the item deleted?
Correct Answer: Option A — At the head of link list
Detailed Academic Explanation:
At the head of link list is the correct answer to “In linked list implementation of a queue, from where is the item deleted”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the space complexity for deleting a linked list?
Correct Answer: Option A — O(1)
Detailed Academic Explanation:
O(1) is the correct answer to “What is the space complexity for deleting a linked list”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is not the type of queue?
Correct Answer: Option B — Single ended queue
Detailed Academic Explanation:
Single ended queue is the correct answer to “Which of the following is not the type of queue”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 16 of 40
★ PPSC
★ FPSC
★ 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; } }
Correct Answer: Option C — Delete the first element in the list
Detailed Academic Explanation:
Delete the first element in the list is the correct answer to “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; } }”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Consider a small circular linked list. How to detect the presence of cycles in this list effectively?
Correct Answer: Option B — Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by one node at a time
Detailed Academic Explanation:
Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by one node at a time is the correct answer to “Consider a small circular linked list. How to detect the presence of cycles in this list effectively”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 18 of 40
★ PPSC
★ FPSC
★ 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?
Correct Answer: Option B — DCBA
Detailed Academic Explanation:
DCBA is the correct answer to “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”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
Correct Answer: Option D — Merge Sort
Detailed Academic Explanation:
Merge Sort is the correct answer to “Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What kind of linked list is best to answer questions like "What is the item at position n?"
Correct Answer: Option D — Array implementation of linked list
Detailed Academic Explanation:
Array implementation of linked list is the correct answer to “What kind of linked list is best to answer questions like "What is the item at position n?"”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity of inserting at the end in dynamic arrays?
Correct Answer: Option D — Either O(1) or O(n)
Detailed Academic Explanation:
Either O(1) or O(n) is the correct answer to “What is the time complexity of inserting at the end in dynamic arrays”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is not an advantage of a priority queue?
Correct Answer: Option D — Easy to delete elements in any case
Detailed Academic Explanation:
Easy to delete elements in any case is the correct answer to “Which of the following is not an advantage of a priority queue”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 23 of 40
★ PPSC
★ FPSC
★ 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.
Correct Answer: Option B — Empty the first jar by removing it one by one from the first jar and placing it into the second jar and empty the second jar by placing all the rings into the first jar one by one
Detailed Academic Explanation:
Empty the first jar by removing it one by one from the first jar and placing it into the second jar and empty the second jar by placing all the rings into the first jar one by one is the correct answer to “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.”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The essential condition which is checked before deletion in a linked queue is?
Correct Answer: Option A — Underflow
Detailed Academic Explanation:
Underflow is the correct answer to “The essential condition which is checked before deletion in a linked queue is”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 25 of 40
★ PPSC
★ FPSC
★ 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?
Correct Answer: Option A — ABCD
Detailed Academic Explanation:
ABCD is the correct answer to “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”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 26 of 40
★ PPSC
★ FPSC
★ 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).
Correct Answer: Option A — O(m)
Detailed Academic Explanation:
O(m) is the correct answer to “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).”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Linked list data structure offers considerable saving in . . . . . . . .
Correct Answer: Option C — Space Utilization and Computational Time
Detailed Academic Explanation:
Space Utilization and Computational Time is the correct answer to “Linked list data structure offers considerable saving in . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 28 of 40
★ PPSC
★ FPSC
★ 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();
Correct Answer: Option D — 5
Detailed Academic Explanation:
5 is the correct answer to “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();”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the space complexity of a linear queue having n elements?
Correct Answer: Option A — O(n)
Detailed Academic Explanation:
O(n) is the correct answer to “What is the space complexity of a linear queue having n elements”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 30 of 40
★ PPSC
★ FPSC
★ 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; }
Correct Answer: Option C — Find and return the position of the given element in the list
Detailed Academic Explanation:
Find and return the position of the given element in the list is the correct answer to “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; }”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity of enqueue operation?
Correct Answer: Option D — O(1)
Detailed Academic Explanation:
O(1) is the correct answer to “What is the time complexity of enqueue operation”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 32 of 40
★ PPSC
★ FPSC
★ 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]); } }
Correct Answer: Option D — reverse the array
Detailed Academic Explanation:
reverse the array is the correct answer to “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]); } }”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Select the code snippet which return true if the stack is empty, false otherwise.
Correct Answer: Option B — public boolean empty() { return q1.isEmpty() || q2.isEmpty(); }
Detailed Academic Explanation:
public boolean empty() { return q1.isEmpty() || q2.isEmpty(); } is the correct answer to “Select the code snippet which return true if the stack is empty, false otherwise.”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What is the time complexity to insert a node based on key in a priority queue?
Correct Answer: Option C — O(n)
Detailed Academic Explanation:
O(n) is the correct answer to “What is the time complexity to insert a node based on key in a priority queue”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What happens when you pop from an empty stack while implementing using the Stack ADT in Java?
Correct Answer: Option C — EmptyStackException is thrown
Detailed Academic Explanation:
EmptyStackException is thrown is the correct answer to “What happens when you pop from an empty stack while implementing using the Stack ADT in Java”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 36 of 40
★ PPSC
★ FPSC
★ 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?
Correct Answer: Option D — Both O(n) and θ(n)
Detailed Academic Explanation:
Both O(n) and θ(n) is the correct answer to “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”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The data structure required to check whether an expression contains a balanced parenthesis is?
Correct Answer: Option A — Stack
Detailed Academic Explanation:
Stack is the correct answer to “The data structure required to check whether an expression contains a balanced parenthesis is”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of these best describes an array?
Correct Answer: Option B — Container of objects of similar types
Detailed Academic Explanation:
Container of objects of similar types is the correct answer to “Which of these best describes an array”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 39 of 40
★ PPSC
★ FPSC
★ 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)?
Correct Answer: Option C — Enqueue
Detailed Academic Explanation:
Enqueue is the correct answer to “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)”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
Question 40 of 40
★ PPSC
★ FPSC
★ 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?
Correct Answer: Option D — n
Detailed Academic Explanation:
n is the correct answer to “In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is”. This question is standard in competitive examination syllabi for Introduction To Data Structures.
💡Key Conceptual Anchor:Introduction To Data Structures
✓Link copied to clipboard
Continue Your Practice
Advanced Mapreduce Concepts — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
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.