Lab 3
IntDLists and Debugging
Last updated
Was this helpful?
IntDLists and Debugging
Last updated
Was this helpful?
Lab spec:
Welcome to lab 3! I won't be covering Git in this lab, but if you need a more comprehensive guide, you can use .
An IntDList
is like an IntList
, but each node has pointers to both the previous element and the next element. Here is an illustration from the lab spec:
Your assignment is to fill out the various methods in IntDList.java
. I recommend trying to implement these without seeing the following tips, and if you get stuck then come back to these.
I cannot stress how important it is to learn how to use the debugger and the Java visualizer in order to succeed in this class. You do not want to be 30 hours into a project worth ~15% of your grade, stressing about a bug that you can't seem to track down, seemingly trying everything but having all the test cases fail, submitting Gitbugs only for them to get rejected (due to no apparent debugging effort), all because you didn't learn how to debug.
Some of you might shrug this warning off thinking that "it won't happen to me", only to find yourself in this exact scenario a few short weeks or months later. Trust me, spend 30 minutes to learn how to debug now, and you'll save yourself hours of frustration in the rest of this course. Take this exercise seriously, do everything that it tells you to do, and you'll thank yourself later.
IntDList
has a _front
and _back
pointer, and each node has a _prev
, _val
, and _next
field.