CMSC-341, Fall 1999, Sections 0101

Binary Search Tree MAKEEMTPY Operation

//---- public makeEmpty ( ) ----- template <class Comparable> void BST<Comparable>::makeEmtpy ( ) { // just call private method makeEmpty ( root ); } //---- private makeEmpty ( ) ------ template <class Comparable> void BST<Comparable>:: makeEmpty ( BinaryNode<Comparable> * & t ) { if ( t != NULL ) { makeEmpty ( t->left ); makeEmpty ( t->right ); delete t; } }
Dennis Frey
Last modified: Sun Sep 26 23:41:36 EDT 1999