Title: Arrays Part 2 Summary
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER

Arrays Part 2 Summary

Selection Sort

- Example: Selection Sort algorithm for sorting arrays of doubles from the textbook

Arrays Part2 Miscellaneous

- Enumerated Types:
  - Purpose- to make your code more readable
  - Features: valueOf, valueOf, ordinal, compareTo, values, works with == and switch statements
  - Examples: WorkDay, Flavor, Months, Chess: ColorType and PieceType
- For-each loop
- Variable numbers of parameters
  - System.out.printf
  - Examples: UtilityClass.java, Utility2.java

Array Multi-Dimensions

- Examples: ticTacToe, battleShip, testScores
- Proper way to go through a 2 dimensional array named page using page.length and page[row].length.
- Demonstrating how memory is organized in a 2 dimensional array called testScores.
- Ragged arrays - flexibility we normally don't need.
- Passing 2 dimensional arrays as parameters
- Returning 2 dimensional arrays from a method

GradeBook and Fantasy Football

- Example: Textbook GradeBook example and its relationship to the Fantasy Football homework

Bubble Sort

- Example: Sorting arrays using a bubble sort algorithm approach

Matching Game

- Example: A game consisting of a 2 dimensional grid of pairs that need to be matched. Inspired by a TV show.

Game of Life

- Example: Simulating a primitive community of Ants. Ants live in a 2 dimensional grid. They die if they are too crowed or too isolated. They also can reproduce under certain conditions.

Last Modified: May 31, 2014 4:38 PM