首页 > > 详细

讲解 CS251 AVL Tree讲解 C/C++编程

CS251 AVL Tree

Requirement

Implement a C++ AVL Tree class AVLTree in files AVLTree.h and AVLTree.cpp

1. The constructor AVLTree () builds the AVLTree.

2. The destructor ~AVLTree() deallocates all dynamically allocated memory.

3. The void insert(int k) method inserts the key k into the AVLTree, and does not do anything if the key is already stored.

4. The void remove(int k) method removes key k from the AVLTree and does not do anything if AVLTree does not contain key k.

5. The items stored are positive integers which serve both as keys and as elements.

6. The void printInorder() method prints the tree to the standard output using an inorder traversal; it prints a (key, height) pair for each node and ends with a newline.

7. The void printPostorder() method prints the tree to the standard output using postorder traversal; it prints a (key, height) pair for each node and ends with a newline.



联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!