Filtered Exam Questions
Filtered Exam Questions
1) Which of the following is a valid postfix expression for the infix expression "A + B * ("2
A. ABC#+
B. AB+C*
C. A+BC*
D. A*B+C
2) Which operation on a stack results in an element being added to the top of the stack?
A. Pop
B. Push
C. Enqueue
D. Dequeue
4) What is the condition for a circular queue to be full when implemented using arrays?
5) Which of the following operations cannot be performed in O(1) time ona queue? — d
A. Enqueue Tis
B, Dequeue om dpe
C. Peek cane eA Rees f,
€ text book,
A. Stack
- Linked List
Heap
. Binary Search Tree
10) What is a common disadvantage of the chaining method for collision Tesolution in hash
tables?
C. Complexity of implementation
D. Higher average-case time complexity for search Operations
11) Which hashing method involves using a hash function to Compute the initial address
and then using
another function to resolve collisions?
A. Chaining
B. Linear Probing
C. Quadratic Probing
(Double Hashing
12) What is the typical load factor threshold for resizing a hash table?
ee eee ee =
0.5
0.7
- 1.0
. O(n)
JO@ log n)
- O02)
D. O(log n)
14) Which algorithm has a space complexity of O(1) for its in-place sorting process?
A. Merge Sort
B. Heap Sort
Quick Sort
- Insertion Sort
16) Which sorting algorithm divides the array into a sorted and an unsorted region, then
iteratively
inserts elements from the unsorted region into the sorted region?
A. Bubble Sort
Insertion Sort
- Quick Sort
D. Merge Sort
A. Merge Sort
. Radix Sort
| | - Quick Sort
| | D. Heap Sort
18) What is the time complexity of the heap sort algorithm?
\. O(n)
3) O(n log n)
C. O(m2)
D. O(log n)
se tS SSS St arenes
ote: Students are allowed to use the text book. ;
——
19) Which searching algorithm works efficiently with a sorted and uniformly distributed
array?
A. Linear Search
B. Binary Search
C. Jump Search
(Dy Interpolation Search
20) What is the time complexity of searching for an element in a balanced binary search tree
(BST)?
A.O(1)
. O(n)
© O(log n)
. O(a log n)