Q. In a queue, which operation is used to remove an element?
-
A.
Push
-
B.
Pop
-
C.
Enqueue
-
D.
Dequeue
Solution
The operation used to remove an element from a queue is called Dequeue.
Correct Answer:
D
— Dequeue
Learn More →
Q. What is the main advantage of using a dynamic array over a static array?
-
A.
Faster access
-
B.
Fixed size
-
C.
Dynamic resizing
-
D.
Less memory usage
Solution
Dynamic arrays can resize themselves when they reach capacity, allowing for more flexible memory usage.
Correct Answer:
C
— Dynamic resizing
Learn More →
Q. What is the main advantage of using a queue?
-
A.
Random access
-
B.
LIFO behavior
-
C.
FIFO behavior
-
D.
Memory efficiency
Solution
A queue operates on a First In First Out (FIFO) principle, which is useful for scheduling and managing tasks.
Correct Answer:
C
— FIFO behavior
Learn More →
Q. What is the primary use of a stack data structure?
-
A.
FIFO operations
-
B.
LIFO operations
-
C.
Random access
-
D.
Dynamic resizing
Solution
A stack operates on a Last In First Out (LIFO) principle, where the last element added is the first to be removed.
Correct Answer:
B
— LIFO operations
Learn More →
Q. Which of the following is a disadvantage of using linked lists over arrays?
-
A.
Dynamic size
-
B.
Ease of insertion/deletion
-
C.
Memory overhead
-
D.
Random access
Solution
Linked lists have a memory overhead due to storing pointers, which makes them less memory efficient compared to arrays.
Correct Answer:
C
— Memory overhead
Learn More →
Showing 1 to 5 of 5 (1 Pages)