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
- Finish your
LinkedListImplementation project.
Bring your questions to the evening office hours in F-217 or email csse221-staff.
- Continue the Simulation project,
paying special attention to what is due in the next few days.
- 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.
- TreeMap and HashMap
are two implementations of the Map interface.
- What are the main advantages of TreeMap over HashMap?
- What are the main advantages of HashMap over TreeMap?
- 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!.
- You do NOT need to enter the code into Eclipse and test it.
- 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.
- You do NOT need to enter the code into Eclipse and test it.
- Write a direct, naive, recursive implementation -- we'll see more efficient recursive
implementations later.