1 / 15

Queue ADT: circular array implementation

Queue ADT: circular array implementation. t. h. Queue ADT: circular array implementation. enqueue(‘A’). h. A. t. Queue ADT: circular array implementation. enqueue(‘D’). h. A. D. t. Queue ADT: circular array implementation. enqueue(‘T’). h. A. D. T. t.

hagop
Download Presentation

Queue ADT: circular array implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Queue ADT: circular array implementation

  2. t h Queue ADT: circular array implementation enqueue(‘A’)

  3. h A t Queue ADT: circular array implementation enqueue(‘D’)

  4. h A D t Queue ADT: circular array implementation enqueue(‘T’)

  5. h A D T t Queue ADT: circular array implementation enqueue(‘E’)

  6. h A D T E t Queue ADT: circular array implementation dequeue()

  7. A h D T E t Queue ADT: circular array implementation dequeue()

  8. A D T h E t Queue ADT: circular array implementation enqueue(‘X’)

  9. A D T h t X E Queue ADT: circular array implementation enqueue(‘A’)

  10. A t D A T h X E Queue ADT: circular array implementation enqueue(‘M’)

  11. t A M D A T h X E Queue ADT: circular array implementation enqueue(‘P’)

  12. t P A M D A T h X E Queue ADT: circular array implementation enqueue(‘L’)

  13. P L t M D A T h X E Queue ADT: circular array implementation enqueue(‘E’)

  14. P L M E A T t h X E Pointing t here will cause problems! When t==h, is queue empty or full? Our circular array must be 1 cell larger than the # of values it’s expected to contain at any given time.

More Related