Computer Fundamentals for Placements – DSA MCQs with Answers
Q. 1 Which data structure uses LIFO (Last In First Out) principle?
Check Solution
Ans: B
A stack follows the LIFO principle where the last inserted element is the first to be removed.
Q. 2 Which of the following has the worst-case time complexity of O(n log n) for sorting?
Check Solution
Ans: C
Heap Sort has a guaranteed worst-case complexity of O(n log n).
Q. 3 Which data structure is best suited for implementing recursion?
Check Solution
Ans: B
Recursion uses the call stack to keep track of function calls.
Q. 4 What is the time complexity of searching in a balanced Binary Search Tree (BST)?
Check Solution
Ans: B
Searching in a balanced BST takes O(log n) time.
Q. 5 Which data structure is used for breadth-first search (BFS) in a graph?
Check Solution
Ans: B
BFS uses a queue to explore nodes level by level.
Q. 6 What is the best case time complexity of Insertion Sort?
Check Solution
Ans: A
In the best case (when the array is already sorted), Insertion Sort runs in O(n).
Q. 7 Which traversal method of a binary tree visits nodes in the order: Left, Root, Right?
Check Solution
Ans: B
Inorder traversal visits Left subtree, then Root, then Right subtree.
Q. 8 Which data structure is typically used to implement priority queues?
Check Solution
Ans: B
Heaps are commonly used to implement priority queues.
Q. 9 In hashing, what is the technique used to resolve collisions by finding the next empty slot?
Check Solution
Ans: B
Open Addressing resolves collisions by searching for the next empty slot.
Q. 10 Which graph representation is more space-efficient for sparse graphs?
Check Solution
Ans: B
Adjacency List is more space-efficient for sparse graphs, as it stores only existing edges.
Next Topic: Java Programming MCQs with Answers for Placements
Practice Aptitude Questions for Placements
Crack Placement Tests: Faster & Smarter
Adaptive Practice | Real Time Insights | Resume your Progress
