10

Queues

Queues Queues

Contents

  • Queues as data structures
  • Queue operations—initialize, en-queue, de-queue
  • Implementing a queue as a class—two versions
  • Priority queues
10.1 INTRODUCTION

Linked lists are useful for applications where frequent deletion and insertion of data occurs. A related structure is one where addition and deletion take place in a special manner. It is a ‘queue’; entering a cinema or sports event or boarding a bus is—or should be—an orderly process operating to the rule ‘first in, first out’ (FIFO). The first person joins an empty queue and will be first to leave it; others join behind at the tail. While queues have some of the ...

Get Introducing Data Structures with Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.