Unit 6-10 HW and Vocab
grades and takeaways from student lessons unit 6-10
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 9
- 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
- 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