TADM2E 3.7

From Algorithm Wiki
Revision as of 18:13, 11 September 2014 by Algowikiadmin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Store two values, the maximum and minimum. These need to be checked and potentially updated on every delete. If a the minimum is being deleted, call the successor, update the minimum and delete the old item. On insert, compare the new item to min/max, if it replaces either one update the min/max accordingly.