The first statement is true. Stacks are a type of data structure that follows the Last-in-first-out (LIFO) principle, where the last element added to the stack is the first one to be removed. This makes it efficient for performing first-in-first-out (FIFO) type of computations, such as undo/redo operations, backtracking, and recursive function calls.
The second statement is also true. Linked lists are a type of data structure where each element is a separate object with a reference to the next element. This allows for fast insertion and deletion of elements, which are commonly used operations in lists. Implementing lists on an array, on the other hand, requires shifting elements to make room for new elements or to fill gaps after deleting elements. This can be time-consuming and not efficient.
The third statement is also true. A circular array is an array that wraps around when it reaches the end, allowing for efficient use of space. Implementing a queue on a circular array allows for fast enqueue and dequeue operations, as well as efficient use of space. Implementing a queue on a linear array with two indices can lead to wasted space, as well as the need to shift elements when one end of the array becomes full.
The last statement is false. Queues are a type of data structure that follows the First-in-first-out (FIFO) principle, where the first element added to the queue is the first one to be removed. This makes it efficient for performing last-in-first-out (LIFO) type of computations, such as breadth-first traversals, scheduling, and load balancing tasks.