CS 210 Challenge Assignments
These assignments are not part of your grade for this course; however, your work on these challenges will be considered should your grade fall on the borderline betwee two grades. More importantly, these challenge assignments will give you a chance to deepen your understanding of some topics you might find usefull to you in programming data structures later on.
-
Linked Lists Challenges As with all challenge assignments, complete the required work and submit it before attempting these challenges. I suggest you copy your Linked List into a new folder and work on the challeges from there.
- Challenge 1: Try creating an
ordered linked list. This will require you to change
only one method you have written, but you could also use
this to discover that an element is not in the
list quicker.
- Challenge 2: Try changing the
problem to add at the back (or tail) of the list
instead of the front. Does this change how the
ListTester class must be written?
- Challenge 3: Try creating a
double-linked list as described in the text. This will
require you to modify the List class to include a
pointer to the tail and the Node class to
include a pointer to the previous node. You will need
to modify your add and remove methods to keep both the
forward and backward pointers updated. If your list is
ordered, your find method could choose the closest route
(forward or backward) to find an item assuming the list
was evenly populated. This might be useful for large
lists.