Unit Score
6 0.9/1
7 0.95/1
8 0.9/1
9 1/1
10 1/1
total 4.75/5

Unit 6

Unit 6 Blog

  • contains a collection of data
  • can be primitive or referenced
  • element - one value in an array
  • index - the position of one value in an array
  • use loop to access array
    • enhanced for loop - use when number of elements in array unknown
    • basic for loop - use with known number of elements

Unit 7

Unit 7 Blog

  • array lists: number of elements an constantly change
  • use loops to traverse arraylists
    • access different elements
  • flagging to locate data
  • use loops also to sort data within array

Unit 8

Unit 8 Blog

  • an array of arrays
  • start with setting data type
  • initialize array
    • number of rows
    • if not known use r = list.length
    • number of columns
    • if not known use c = list[0].length
  • use : to search for an element within array

Unit 9

Unit 9 Blog

Unit 9 Hacks

  • different classes can have methods and attributes unique to them
  • extends can inherit the same methods and attributes and also some unique to themselves
  • attributes of subclass same as superclass if nothing changed
    • add additional assignment if new
  • use super to access the superclass constructor with subclass
  • same parameter in subclass overrides the parent class

Unit 10

Unit 10 Blog

  • two parts to method
    • repeat recursive call until return statement
  • base case returns number - purpose is to not have a recursive statement
  • binary sort
    • most efficient method cut in half again and again
  • merge sort: sort arraylist, divide array into halves and merge together
  • cannot have void because it will not return anything
  • call stack - keeps track of how many times the recursive is called
  • iterations have set instructions use for and while loops
    • recursions use function calls
  • linear recursion - single call to itself
  • selection sort - minimum from unsorted and putting it at the end of the sorted