edited by
24,622 views
52 52 votes

Consider the following statements:

  1. First-in-first out types of computations are efficiently supported by STACKS.

  2. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations.

  3. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices.

  4. Last-in-first-out type of computations are efficiently supported by QUEUES.

  1. $(ii)$ and $(iii)$ are true
  2. $(i)$ and $(ii)$ are true
  3. $(iii)$ and $(iv)$ are true
  4. $(ii)$ and $(iv)$ are true

7 Answers

Best answer
41 41 votes
edited by
15 15 votes

Answer : (A)

Corrections :

First-in-first out types of computations are efficiently supported by QUEUES.

Last-in-first-out type of computations are efficiently supported by STACKS

12 12 votes
A) Wrong stack is used for implementation of LIFO order

B) true provided list is dynamic in nature, for static list both will have same performance

C) can be true if we implementation circular queue using 2 pointer, else no advantage

D) false, queue is used to support FIFO
3 3 votes
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.
1 flag:
✌ Edit necessary (Himanshu_2211 “edit :- First statement is false.”)
0 0 votes

Stack operates on FIRST IN LAST OUT or LAST IN FIRST OUT principle.

Whereas Queue operates on FIRST IN FIRST OUT principle.

Therefore, statements i. and iv. are False

Hence, Correct Option is A) (ii) and (iii) are true

Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.3k
1.3k views
Souvik33 asked Nov 2, 2022
1,337 views
Which data structure would be most appropriate to implement a collection of values with the following 3 characteristicsSingly link list with head and tail pointerDoubly l...
39 39 votes
7 answers 7 answers
31.3k
31.3k views
Kathleen asked Sep 14, 2014
31,310 views
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$?OneTwoThreeFour
27 27 votes
3 answers 3 answers
7.0k
7.0k views
Kathleen asked Oct 9, 2014
6,994 views
Which of the following sequences denotes the post order traversal sequence of the below tree?$f\; e\; g\; c\; d\; b\; a$$g\; c\; b\; d\; a\; f\; e$$g\; c\; d\; b\; f\; e\...