Skip to main content

CSC 207.02 2019S, Class 27: Doubly-linked lists

Overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Some quick notes
  • Lab

Preliminaries

News / Etc.

  • For the exam, make sure to put each test in the correct directory and the new version of TestUtils.java in the utils directory.
  • Note: A lot of today’s lab is “think about how to design code, then compare to my design”. You will find the lab most beneficial if you actually spend the time thinking and comparing.
  • It appears that today’s lab is the right length. Most of the a.m. class finished right before the end of class. (A few people finished much earlier.)

Upcoming work

  • Readings for Friday
  • Makeup exam 1 due Thursday the 11th
    • You can bring your printed version to class on Friday
  • Lab writeup: Exercise TBD

Extra credit

Please send me these in advance.

Extra credit (Academic/Artistic)

Extra credit (Peer)

  • Track and Field Saturday at Mount Mercy.
  • ISO Culture Show April 20 7pm in Harris Gym.
  • Treasure Exchange Saturday, LLL; bring stuff 11-noon, grab stuff between noon and 1.

Extra credit (Wellness)

  • Friday, April 12, 4-6pm: Make fidgets. Maker lab, 927 Broad street. For more information or accommodation, contact [bernalma] or [phamanht]
  • Monday, April 15, 7:30 p.m., Harris Cinema: From the Munchies to Memory Effects: What the Science Says About Cannabis/Marijuana

Extra credit (Wellness, Regular)

  • 30 Minutes of Mindfulness at SHACS every Monday 4:15-4:45
  • Any organized exercise. (See previous eboards for a list.)
  • 60 minutes of some solitary self-care activities that are unrelated to academics or work. Your email reflection must explain how the activity contributed to your wellness.
  • 60 minutes of some shared self-care activity with friends. Your email reflection must explain how the activity contributed to your wellness.

Extra credit (Misc)

  • CANCELLED: “State of SHAW” talk Thursday at 11am in JRC 101.
  • Wednesday the 10 at 4pm at Darby: Not-as-giant Laurel Leaf. (Free t-shirt!)
  • Scarlet and Give Back Day TODAY.
  • Participate in Kinetic Sculpture Competition: Saturday the 27th
    • https://bit.ly/kineticsculpture19
    • You’ll need to build your sculpture in advance
    • You get reimbursed for up to $200 in supplies, but must present to be reimbursed.
  • Info session on KSC this Friday at 7pm at MLab.
    • Between 4th and 5th on Broad, on the West side of the street, between Jensen Optometrists and the Bike Store.
  • Emmet Ramstad Thursday at 7:30 in JRC 101 for Pride Week.
  • Harold Green “Clean House” Friday at 6:00 in BCC.
  • Environmental studies activity in Fall semester.
  • Clothing donation boxes in lounges. Donate! (Also Prom Dresses.)

Other good things

  • Talk to M about applications for alt break.

Questions

Some quick notes

Our goal: Implement lists as linked structures. Why? Because insertion and removal in arrays is slow.

Because our list iterator objects support prev, we want to be able to move backwards as well as forwards. Hence, we make nodes with two links.

Improvement one: To avoid checking “is X null”, we put a dummy node at the front or end of the list (or both).

Improvement two: To avoid checking whether prev/next are null, we make the next link of the last element point to the first element (or the dummy) and vice versa.

Lab