Binary Search Tree Destructor

前端 未结 6 1367
太阳男子
太阳男子 2021-02-04 13:51

Working on implementing my own BST in C++ for the experience of dealing with such structures.

I\'ve had trouble implementing a destructor. I found in my studies, that on

6条回答
  •  北海茫月
    2021-02-04 14:35

    You can also use recursion, you just need to change the function header to:

    void remove(node*& root) 
    

    and it will work.

提交回复
热议问题