GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
81 views
Which of the following data structure may give overflow error, even though the current number of element in it is less than its size ?

(A) Simple Queue

(B) Circular Queue

(C) Stack

(D) None of these
asked in DS by Junior (527 points)   | 81 views
simple queue

Both A and B.

In circular queue, if we insert n elements then Rear = Front represents both empty queue and Completely full queue. To avoid ambiguity we declare circular queue full after inserting only N - 1 elements.

2 Answers

0 votes

Simple Queue

As we know the overflow condition of simple queue is 

If (REAR  = MAX) then

Overflow

The linear queue suffers from serious drawback that performing some operations, we can not insert items into queue, even if there is space in the queue. Suppose we have queue of 5 elements and we insert 5 items into queue, and then delete some items, then queue has space, but at that condition we can not insert items into queue.

So A is the answer 

answered by (267 points)  

look at the link u provide..

the memory is utilized more efficient in case of circular queue's.

in cicrcular queue as we can again go back to the first node from the last node ...so we can utilize those vacant places.But in simple queue we cant 

yes. a should be the answer
0 votes
Simple queue because if in simple queue only 1 element is present at last index and then if we try to enqueue then it will give overflow error to avoid thia problm circular queue is introduced.
answered by (221 points)  

Related questions

+1 vote
1 answer
1
asked in Computer Networks by jothee Veteran (79.2k points)   | 85 views
+1 vote
3 answers
2
+1 vote
1 answer
3


Top Users Aug 2017
  1. Bikram

    5174 Points

  2. ABKUNDAN

    4730 Points

  3. akash.dinkar12

    3504 Points

  4. manu00x

    3492 Points

  5. rahul sharma 5

    3188 Points

  6. makhdoom ghaya

    2700 Points

  7. just_bhavana

    2432 Points

  8. stblue

    2244 Points

  9. Tesla!

    2090 Points

  10. pawan kumarln

    1874 Points


25,066 questions
32,220 answers
75,083 comments
30,231 users