3,502 views
1 votes
1 votes
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

2 Answers

0 votes
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 

0 votes
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.

Related questions

2 votes
2 votes
1 answer
1
go_editor asked Sep 28, 2016
532 views
What layer of the OSI model is designed to perform error recovery functions?physicaldata linknetworktransport
2 votes
2 votes
4 answers
2
2 votes
2 votes
1 answer
3
1 votes
1 votes
3 answers
4