Lecture 19, CS 302-7 and 8, March 5

 

  1. Reminders
    1. Exam 1 – Thursday

                                                               i.      No 2d arrays on exam

    1. Program 2 – March 16

                                                               i.      Note announcement on course website

    1. Exam 1Review session

                                                               i.      Tuesday, 5:30-6:30

    1. High-level introduction to radial basis function networks (program 2)
  1. Review
    1. Arrays as parameters and return values for methods
    2. 2d arrays
  2. 2d+ arrays
    1. Declaring

                                                               i.      [][] or {{,},{,},…}

    1. Referencing element

                                                               i.      [i][j]

    1. Behind the scenes

                                                               i.      Pointers to pointers

    1. Using

                                                               i.      traversing – with nested for loops

1.      based on x.length, x[i].length

2.      Note – i and j can have different lengths – these 2d arrays don’t need to be ‘square’

3.      but, 2d arrays must be ‘rectangular’

                                                             ii.      TopicsChooser.java

  1. Review
    1. ArrayParameters.java (from spring 2011 exam)