Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Programming Languages > Data Structures

Data Structures Data Structures Interview Questions, Learn by sharing Data Structures Interview Questions asked in various Companies, Get Career advices, Interview Procedures from Data Structures experts, Post asked Data Structures Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-31-2008, 09:51 AM
Senior Member
 
Join Date: Feb 2008
Posts: 9,095
Default What do we need circular queue

What do we need circular queue?
Reply With Quote
  #2 (permalink)  
Old 04-25-2008, 03:36 PM
Junior Member
 
Join Date: Apr 2008
Posts: 17
Thumbs up

If a queue is represented by using arrays, once the rear pointer reaches the maximum, we cannot add any more item to the queue even if we delete all the items. To do so, we have to reset the rear pointer whenever both rear and front are pointing to the maximum possible position. Another clever way is to use circular lists, which uses the modulo arithmetic, to automatically readjust the rear pointer back to the first position after the last position.
Reply With Quote
Reply

Tags
data structures, interview questions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On