Q. In a queue, which operation is performed to remove an element?
-
A.
Push
-
B.
Pop
-
C.
Enqueue
-
D.
Dequeue
Solution
The operation to remove an element from a queue is called Dequeue, following the FIFO (First In, First Out) principle.
Correct Answer:
D
— Dequeue
Learn More →
Q. In a stack, which operation is used to remove the top element?
-
A.
Enqueue
-
B.
Dequeue
-
C.
Push
-
D.
Pop
Solution
The operation used to remove the top element from a stack is called 'Pop'.
Correct Answer:
D
— Pop
Learn More →
Q. What is the time complexity of accessing an element in an array by index?
-
A.
O(n)
-
B.
O(log n)
-
C.
O(1)
-
D.
O(n log n)
Solution
Accessing an element in an array by index is O(1) because it requires a constant amount of time regardless of the size of the array.
Correct Answer:
C
— O(1)
Learn More →
Q. Which of the following is NOT a type of sorting algorithm?
-
A.
Quick Sort
-
B.
Merge Sort
-
C.
Heap Sort
-
D.
Stack Sort
Solution
Stack Sort is not a recognized sorting algorithm; the others are well-known sorting techniques.
Correct Answer:
D
— Stack Sort
Learn More →
Showing 1 to 4 of 4 (1 Pages)