COMP 202 Final Review

Some announcements

  1. I won't be able to hold office hours today. If you want to meet with me, please send me an e-mail. I will be available after 1:p.m. On Wednesday and all day on Thursday.

  2. The final exam is on Tuesday, December 9th from 6:00 p.m. till 9:00 p.m.. Please take a look at the final exam schedule for the location of the exam.

In the Final Exam

  1. Binary numbers ( BInary to Decimal, Decimal To Binary)
  2. Primitive Types: int, boolean, String, double
  3. Type casting
  4. Operations: +, -, *, /, ++, --, +=, -=, %
  5. Boolean Logic: AND, OR, NOT (&&, ||, !)
  6. Comparisons: >, >=, <, <=, ==, !=
  7. Conditional Statements: if, else if, else
  8. Loops: for and while
  9. Arrays
  10. Methods, Passing variables to methods: Primitive types, and reference types ( Arrays, Objects )
  11. Sorting (Bubble Sort, Insertion Sort, and other sorting algorithms)

In the Final Exam

  1. Data structures
    • Node class in LinkedList and doubly LinkedList
    • what is a hashing function, what is a collision
    • ArrayList and Hashtable, and the reference types ( Integer, String, Double, Character )
  2. Classes and Objects
    • constructors, object methods and variables
    • static variables and methods
    • public and private variables
  3. Exceptions
    • try, catch, throws
    • ArrayIndexOutOfBounds
    • NullPointerException

NOT int the Final Exam

  1. Complexity
  2. Recursion
  3. Merge sort
  4. Advanced topics ( Except for tthe part where we created a Robot object )

How would you know you are prepared for the Final exam?

If you feel comfortable answering all of the questions in all of the Assignments, you are prepared for the final

Some exercises

Mystery method 1

Mystery method 2

Mystery method 3

Mystery method 4

Mystery methods revealed

  1. mysteryMethod1: the good old swap method
  2. mysteryMethod2: the good old bubbleSort algorithm
  3. mysteryMethod3: the previously unknown selectionSort algorithm
  4. MyMysteryBox, mysteryMethod4: Question 15 from the midterm

For the final, you just need to be able to keep track of the state of variable when executing a piece of code line by line

Practice Exercise on Objects - Implementing a MiniString class

Create a replacement for the Java String class, call it MiniString

Follow the specification form this file: http://cim.mcgill.ca/~gamboa/cs202/Material/notes/MiniString.pdf

Linked Lists

This is a visual representation of a linked list using int values

  1. How would you write a method that finds the maximum number in a LinkedList?

  2. How would you write a method that finds the average of the numbers in a LinkedList?

Exceptions

What type of eception would these pieces of code throw?



Tips for the final

Resources

/