This chapter is an introduction to the construction of data structures in Ada using arrays, records and access types. Here we discuss the language support for implementing data structures; their encapsulation into abstract data types will be presented in the next chapter.
The case study is the implementation of a priority queue, first using arrays and then using pointers. A priority queue is a data structure that stores items so that retrieval of the item of the highest priority can be done efficiently, although insertion of new items may be less efficient. In the case study, we assume that the items are simply integers and that higher-priority items have lower values. This is a common situation: customers in a store take numbered tickets and the lowest outstanding number is served first.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag London Limited
About this chapter
Cite this chapter
(2009). Elementary Data Structures. In: Ben-Ari, M. (eds) Ada for Software Engineers (Second Edition with Ada 2005). Springer, London. https://doi.org/10.1007/978-1-84882-314-3_5
Download citation
DOI: https://doi.org/10.1007/978-1-84882-314-3_5
Publisher Name: Springer, London
Print ISBN: 978-1-84882-313-6
Online ISBN: 978-1-84882-314-3
eBook Packages: Computer ScienceComputer Science (R0)