A Brief Introduction to Data Structures

A data structure is a collection of one or more variables taken as a group. Consider the storage of an inventory item. The computer needs to track the following values for each item:

  • Part Number

  • Quantity

  • Description

  • Cost

  • Retail Price

caution

A binary search always requires that you sort the array before you begin the search.

Of course, the company will have many items, so these values will be stored on the disk, probably read into five arrays, and managed from there.

Data Structures Help Group Data

The problem with using separate arrays is that your code must keep track of multiple arrays for the same inventory ...

Get Absolute Beginner's Guide to Programming, Third Edition 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.