Algorithms and OOD (CSC 207 2013F) : EBoards

CSC207.01 2013F, Class 48: Hash Tables, Continued


Overview

Preliminaries

Admin

Quick exam comment

In spite of a curriculum that emphasizes recursion, you folks are much too reluctant to use recursion. How recursion helps with remove

 Node remove(key, Node here)
      // Case: Nothing left
      return null;

      // Case: Keys match
      ...
      return recomputedTree;

      // Case: Key is less than here.key
      here.smaller = remove(key, here.smaller);
      return here;

      // Case: Key is bigger than here.key
      here.larger = remove(key, here.larger);
      return here;

One of the many things you didn't learn in 161

  x = foo ? bar : baz;

This is the legendary C "conditional expression".

Questions on Hash Tables

Lab

Copyright (c) 2013 Samuel A. Rebelsky.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.