Java Reference
In-Depth Information
8
Object-Oriented Data-Structures
8.1 Introduction
In this chapter, we describe the two most fundamental data-structures usually
encountered in applications: stacks and queues. We begin by explaining
the queue data-structures and their generalization to priority queues. We
then describe stacks. Furthermore, we introduce the notion of abstract data-
structures defined by their prototype interfaces , and show how to program
these abstract data-structures using the object-oriented functionalities of Java.
We revisit some of the static functions handling data-structures covered in the
previous chapters into the OO paradigm by designing class methods that act
on objects themselves.
8.2 Queues: First in first out (FIFO)
8.2.1 Queues as abstract data-structures: Interfaces
A queue is a generic abstract data type for storing incoming objects while
preserving their order of arrival. That is, incoming objects are time-stamped
and processed according to their arrival date. The basic operations that queues
 
Search WWH ::




Custom Search