Question
What is the relationship between a queue and its underlying array?

Answers

Data stored in a queue is actually stored in an array. Two indexes, front and end will be used to identify the start and end of the queue.
When an element is removed front will be incremented by 1. In case it reaches past the last index available it will be reset to 0. Then it will be checked with end. If it is greater than end queue is empty.
When an element is added end will be incremented by 1. In case it reaches past the last index available it will be reset to 0. After incrementing it will be checked with front. If they are equal queue is full.   Your Comment






Search
Can you Answer!!
  • Q Which field in the Customer Master Record controls the One Time Accounts?
  • Q What does "contain" and "matches" indicates in the regular expression?
  • Q Name one product that Amazon has featured.
  • Q Mexican artist Diego Rivera painted the 'Man at the Crossroads' mural on which vast building complex in New York City named after a famous oil and banking family?
  • Q What testing is done during Agile?
  • Q The headquarters of the South-Eastern Railway.
  • Q Explain a. Entity b. Entity Type c. Entity Set
  • Q What is an ABAP data dictionary?
  • Q A. Nageshwara Rao is associated with which field?
  • Q First Bank In India was?
  • Q Can we use data-grids for our report in ssrs?