Algorithms and OOD (CSC 207 2013F) : EBoards
In spite of a curriculum that emphasizes recursion, you folks are much
too reluctant to use recursion. How recursion helps with
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".
Copyright (c) 2013 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.