17

Case Study 4—A Queue Simulation

17.1 INTRODUCTION

Chapter 10 introduced the topic of queues including the priority queue, which holds items in the order of some defined criterion. This case study will build an application to simulate such a queue. It also includes the process of writing data to a disk file as described in Chapter 4.

17.2 THE APPLICATION

Checking in for a flight includes being given a boarding card printed with a seat number for the aircraft cabin. However, many low-cost airline operators do not allocate seats at check-in, leaving passengers to pick one when they board instead. An attempt is made to avoid a free-for-all from developing as a result, as follows:

When booking a budget flight, it is often possible at extra cost ...

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.