CS 145 Lecture 29 – ArrayList and 2D Arrays
Agenda
- what ?s
- program this
- ArrayList vs. array
- to higher dimensions
TODO
- Finish homework 5.
Note
We start with a Program This in two installments:
You are an armchair runner. Instead of competing in races, you like to figure out where you would have finished had you actually run. You want to write a method that determines your place in some race. First, what incoming data do you need to solve this?
Now for installment 2:
Write this method.
We’ll discuss your solutions and implement one in Java. Our times will come from a file, which we will read. We will encounter the ageless problem: as we read the the numbers, we need to a place to store them. But we can’t store them in an array until we know how many elements we have. What workarounds to this problem are there?
Code
…
Haiku
For A, I need B
But to get B, I need A
I C the problem
But to get B, I need A
I C the problem