www.gibmonks.com

Main Page




Previous Page
Next Page

[Page 326]

Chapter 7. Arrays and Vectors

Now go, write it before them in a table, and note it in a book.

Isaiah 30:8

To go beyond is as wrong as to fall short.

Confucius

Begin at the beginning, ... and go on till you come to the end: then stop.

Lewis Carroll

OBJECTIVES

In this chapter you will learn:

  • To use the array data structure to represent a set of related data items.

  • To use arrays to store, sort and search lists and tables of values.

  • To declare arrays, initialize arrays and refer to the individual elements of arrays.

  • To pass arrays to functions.

  • Basic searching and sorting techniques.

  • To declare and manipulate multidimensional arrays.

  • To use C++ Standard Library class template vector.


[Page 327]

Outline

7.1 Introduction

7.2 Arrays

7.3 Declaring Arrays

7.4 Examples Using Arrays

7.5 Passing Arrays to Functions

7.6 Case Study: Class GradeBook Using an Array to Store Grades

7.7 Searching Arrays with Linear Search

7.8 Sorting Arrays with Insertion Sort

7.9 Multidimensional Arrays

7.10 Case Study: Class GradeBook Using a Two-Dimensional Array

7.11 Introduction to C++ Standard Library Class Template vector

7.12 (Optional) Software Engineering Case Study: Collaboration Among Objects in the ATM System

7.13 Wrap-Up

Summary

Terminology

Self-Review Exercises

Answers to Self-Review Exercises

Exercises

Recursion Exercises

vector Exercises


Previous Page
Next Page