What is the relationship between a queue and its underlying array?
Submitted by: AdministratorData 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.
Submitted by: Administrator
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.
Submitted by: Administrator
Read Online Data Structures Job Interview Questions And Answers
Top Data Structures Questions
☺ | What is data structure? |
☺ | List out the areas in which data structures are applied extensively? |
☺ | If you are using C language to implement the heterogeneous linked list, what pointer type will you use? |
☺ | What is the data structures used to perform recursion? |
☺ | What are the methods available in storing sequential files ? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |