Homework 19
CSSE 221 – Fundamentals of Software Development Honors
Fall 2008–2009

Recall the Due Dates and (from the syllabus) the Late (and early) Assignment Policy and guidelines for maintaining Academic Integrity.

Also recall that you can get help on any of these problems during the CSSE lab assistant hours, and you can use the Assignments Discussion Forum on Angel to discuss, clarify, or get help on these problems.

Things to do

  1. Finish your LinkedListImplementation project. Bring your questions to the evening office hours in F-217 or email csse221-staff.
  2. Continue the Simulation project, paying special attention to what is due in the next few days.
  3. Do the written problems below.

Written problems

Write your answers to these questions. Turn your answers in via the appropriate Homework Drop Box on Angel.

  1. TreeMap and HashMap are two implementations of the Map interface.
    1. What are the main advantages of TreeMap over HashMap?
    2. What are the main advantages of HashMap over TreeMap?
  2. The number n factorial, n!, is defined by:
    	n! = n x (n-1)!  for n > 0
    	0! = 1
    
    Write a recursive function factorial(n) that returns n!.
  3. The nth Fibonacci number, written fibonacci(n), is defined by:
    	fibonacci(0) = 0
    	fibonacci(1) = 1
    	fibonacci(n) = fibonacci(n-1) + fibonacci(n-2) for n > 1
    
    Write a recursive function fibonacci(n) that returns the nth Fibonacci number.