Final exam Study Guide
Topics since Midterm 2:
Chapter 10. Sorting, Searching, Big O
- understand how selection sort, insertion sort, linear search, and binary search work
- calculate the complexity of an algorithm by counting the number of comparisons
- calculate the Big-O complexity of an algorithm in the number of comparisons
Chapter 12. Recursion
- design a recursive method
- make sure that the recursion ends
- make sure that the results are correct
- defining the base case
- making progress toward the base case with each recursive call
- tracing recursive methods
- when to use recursion and when not to
Chapter 13. Linked List
- create a node in a linked list
- trace a linked list (e.g. print the content, calculate the size)
- insert a node in a desired location in the linked list
- remove a node at a desired location in the linked list
- find a node with a certain content in the linked list
- remove a node with a certain content in the linked list
- cost analysis of common operations (add, remove), esp. compared to arrays
Others
Topics between Midterm 1 and Midterm 2:
- Polymorphism by Inheritance and Interfaces
- definitions and usage: protected, this, super, extends, implements, abstract class, abstract method, implements
- dynamic binding
- casting
- method overriding
- Comparable
- variable scope: {}, method, class, super class
- Exceptions
- Checked vs. unchecked
- Two ways of handling exceptions: propagating vs. try/catch
- How to make and use your own Exception class
Topics before Midterm 1:
- Java syntax
- variable declaration: primitive vs. reference
- definition and usage: static, final
- variable and method name convention
- object instantiation
- variable initialzation
- mathematical operations
- if-else statements, logical operators (&&, ||)
- iterations (for loops and while loops)
- Class
- class name
- class variables
- instance variables
- constructors (special methods that return objects)
- methods
- visibility modifiers: public, private
- Methods
- calling static methods
- calling non-static methods
- method structure
- return type
- parameters
- array/ArrayList
- how to create an array vs. ArrayList
- how to access elements in an array vs. ArrayList
- length vs. size()
- NullPointerException in Object array and ArrayList
- how to create and use 2-dimensional array
- Scanner
- How to instantiate a Scanner object with keyboard input
- How to instantiate a Scanner object with a file
- How to read a word/line/number from Scanner object
- Strings
- equals() vs ==
- + operator