Structured Data Type - Array

3/5/99


Click here to start


Table of Contents

Structured Data Type - Array

Outline

Outline (cont)

Outline (cont)

Sample Problem

Representing Sales Data

Updating Sales Data

Data Structure

Parts of an Array

Declaring a 1D Array

Array Indices

Accessing Array Elements

Invalid Array Usage

Array Initialization

Array Initialization

Sales Data as an Array

Updating Sales Data

Updating with Arrays

Using Array Elements

Arrays and Loops

Processing All Elements of Array

Initialize with Data from File

Array Programming Style

Summing Elements in an Array

Maximum Element of an Array

Printing Elements of an Array

Passing an Element of an Array

Passing Array Element Examples

Passing Whole Array

Passing Whole Array Example

Size of an Array

Sorting Arrays

Sorting Order

Sorting in Arrays

Selection Sorting

Selection Sort Example

Selection Sort Notes

Selection Sort Algorithm

Selection Sort Algorithm

Code for Selection Sort

Selection Sort Example

Modularizing Sort

Modularizing Sort - Find Smallest

Modularizing Sort Itself

Another Sort: Insertion

Inserting into Sorted Segment

Insertion Sort Code

Searching Arrays

Sequential Search

Sequential Search Example

Sequential Search Example

Sequential Search (Sorted)

Sorted Sequential Search Example

Binary Search

Code for Binary Search

Binary Search Example

Binary Search Example

2-Dimensional Array Declaration

2D Array Element Reference

2D Array Initialization

Processing 2D Arrays

2D Example

Passing 2D Array Parameters

Passing Element of Array

Passing Row of Array

Passing Entire Array

2D Array Example

Multi-Dimensional Array Declaration

Multi-Dim Array Reference

Author: Richard Maclin

Email: rmaclin@d.umn.edu

Home Page: http://www.d.umn.edu/~rmaclin/

Download presentation source