Skip to main content

CSC 301.01, Class 22: Pause for breah


  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • HackerRank problem, continued
  • Debrief
  • Tim Sort (if time)

News / Etc.

Upcoming work

  • Assignment 6 due Wednesday after break at 10:30 p.m.
  • For Monday after break, read Jon Bentley. 1983. Programming pearls: Writing correct programs. Commun. ACM 26, 12 (December 1983), 1040-1045. DOI=
    • If you need a PDF, let me know.

Extra credit (Academic)

Extra credit (Peer)

Extra Credit (Misc)

Other good things

  • Have a great break.
  • Consent is absolutely, positively, necessary.


The Problem from HackerRank

Work on it.


Why are we doing a HackerRank problem in class?

  • Being able to implement stuff is good.
  • HackerRank problems (or at least this one) ask you to look at common data structures in a somewhat different perspective.
  • For better or for worse, some job interview will require HackerRank or the equivalent. Practice is good.
  • Some of you need support in writing C. int *counterp = 0.

What did you learn trying to implement this?

  • Having PMG in your group is a good idea.
  • It’s hard to implement a data structure you don’t completely understand.
  • Recursion is your friend.
  • Dealing with the null nodes requires extra thought.
  • Bad design choices can ripple.
  • Working in a group is great because different people have different ideas.
  • Pictures are helpful.
  • Sanity checks are good, but may interfere