Using Them Well

Using Them Well: Why Can't the Dictionary Find Card 1042? Good Keys, When a Loop Inside a Loop Is Too Slow: Hash Tables at Work.

Updated

  1. Why Can't the Dictionary Find Card 1042? Good Keys (Journeyman): Find a member's locker from the card scanned this morning, when both of the gym's branches have a member 1042: why the card object, the member number alone and equality on its own each fail, and how to make your own type a key that works in your language.
  2. When a Loop Inside a Loop Is Too Slow: Hash Tables at Work (Journeyman): Turn the gym's slow year-end reports into one pass: count each member's visits, find the first member to come back, and stop asking a slow server the same question twice. Then choose a list, a set or a dictionary for a job, and say why.