Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-cnmwb Total loading time: 0 Render date: 2024-07-25T02:12:52.191Z Has data issue: false hasContentIssue false

2 - Linear Lists

Published online by Cambridge University Press:  10 November 2016

Shmuel Tomi Klein
Affiliation:
Bar-Ilan University, Israel
Get access

Summary

Managing Data Storage

In our first steps as programmers, we often write short programs with a quite limited number of variables. Very soon, however, the programming tasks get more involved, and we need some advanced tools to manage efficiently the increasing number of elements dealt with by our programs. This is the role of what has become known as Data Structures, which are the subject of this book.

When coming to organize the data we are supposed to handle, we shall deal with entities called records, like the one in Figure 2.1, representing, in this chapter's running example, the information about a given student at some university. A record may be divided into fields, each standing for a data item relating to the given student, like the name, given name, address, field of study, a list of courses and their grades, etc. One of the fields is particular in that it will serve to identify the records and to distinguish between them. It is emphasized in Figure 2.1, its content is called here ID number, and the assumption will be that different records have different IDs.

Our task is to maintain a large collection of such records, allowing efficient access and updates. Maintaining means here to store the records in such a way that queries about any of their data fields may be processed quickly, but also to facilitate subsequent changes, like insertions of new records, or deletion of those that are not needed any more. Getting back to our example, a student might ask what grade she got on a specific course, a new record has to be allocated if a new student enrolls, and the records of students who finished their studies should be erased from the current list and possibly transferred to another collection, dealing with alumni.

The technical problem of processing records with variable length fields may be overcome by storing the records wherever convenient, and keeping only a list of fixed length (ID, pointer) pairs. We may then restrict our attention to processing only the list of IDs, and shall henceforth narrow our discussion to the handling of the identifying field alone.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Linear Lists
  • Shmuel Tomi Klein, Bar-Ilan University, Israel
  • Book: Basic Concepts in Data Structures
  • Online publication: 10 November 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316676226.003
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Linear Lists
  • Shmuel Tomi Klein, Bar-Ilan University, Israel
  • Book: Basic Concepts in Data Structures
  • Online publication: 10 November 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316676226.003
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Linear Lists
  • Shmuel Tomi Klein, Bar-Ilan University, Israel
  • Book: Basic Concepts in Data Structures
  • Online publication: 10 November 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316676226.003
Available formats
×