Native Arrays and Array Lists
- Let's talk about native arrays vs. Ruby arrays (
ArrayListin Java) - Let's write
lib/array_list.rbwhere we will simulate what happens "under the hood" with Ruby's Array object.- together:
initialize,add,delete,to_s,include?,size - on your own:
max
- together:
Array Lists vs Linked Lists
- Let's talk about linked lists
- Let's take look at
lib/linked_list.rband see how the implementation is different (but the interface is the same) and uses nodes instead of a native array to store data.- provided:
Nodeclass,LinkedListclass:initialize,add,delete,to_s - together:
include?,size - on your own:
max
- provided:
Interfaces vs Implementations
- Let's look at
lotto.rband talk about interfaces vs implementations - Let's make it so that lotto ticket numbers are always displayed in numerical order. Do this by modifying the
add(value)method inArrayList - Do the same for
add(value)method inLinkedList