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 DS queue circular + – Roshan Pawar asked Jun 19, 2017 Roshan Pawar 3.5k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Hira Thakur commented Jun 19, 2017 reply Follow Share simple queue 0 votes 0 votes Hemant Parihar commented Jun 19, 2017 reply Follow Share 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. 0 votes 0 votes Please log in or register to add a comment.
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 No_name answered Jun 19, 2017 No_name comment Share Follow See all 3 Comments See all 3 3 Comments reply Roshan Pawar commented Jun 19, 2017 reply Follow Share Why not (B) ?? check this out : http://nptel.ac.in/courses/106103069/Module_3/queue/circular_queue.htm 1 votes 1 votes No_name commented Jun 19, 2017 reply Follow Share 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 1 votes 1 votes rahul sharma 5 commented Jun 19, 2017 reply Follow Share yes. a should be the answer 0 votes 0 votes Please log in or register to add a comment.
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. Ankit001 answered Jul 13, 2017 Ankit001 comment Share Follow See 1 comment See all 1 1 comment reply Rishav kashyap commented Sep 15, 2017 reply Follow Share But if initially value of front and rear are kept zero in circular queue of size n then the maximum number of elements it can have would be n-1 0 votes 0 votes Please log in or register to add a comment.