?????????AVL?????C++???
???????????? ???????[ 2016/9/29 14:17:03 ] ??????????????????? C++ ??
????/****************************************************************
????* ?????????lessOrderPrintTree()
????* ????????: ?????С??????????????????
????* ?????б?: ??
????* ??????????
????*****************************************************************/
????template<typename Comparable>
????void AvlTree<Comparable>::lessOrderPrintTree(AvlNode * t)
????{
????if(t != NULL){
????lessOrderPrintTree(t->left);
????cout << t->element << " ";
????lessOrderPrintTree(t->right);
????}
????}
????/****************************************************************
????* ?????????makeEmpty()
????* ????????: ????AVL????????
????* ?????б?: ??
????* ??????????
????*****************************************************************/
????template<typename Comparable>
????void AvlTree<Comparable>::makeEmpty()
????{
????makeEmpty(root);
????}
????/****************************************************************
????* ?????????makeEmpty(struct AvlNode * t)
????* ????????: ???t?????????
????* ?????б?: t ??????????
????* ??????????
????*****************************************************************/
????template<typename Comparable>
????void AvlTree<Comparable>::makeEmpty(AvlNode * t)
????{
????if(t != NULL){
????makeEmpty(t->left);
????makeEmpty(t->right);
????delete t;
????}
????}
????/****************************************************************
????* ?????????isEmpty()
????* ????????: ?ж??????????
????* ?????б?: ??
????* ??????????????????true;??????false;
????*****************************************************************/
????template<typename Comparable>
????bool AvlTree<Comparable>::isEmpty() const
????{
????return (root == NULL) ? true : false;
????}
????//??????????
????int main()
????{
????vector<int> v;
????AvlTree<int> tree;
????for(int i = 0; i < 10; i++)
????v.push_back(rand() % 10);
????cout << "v: ";
????for(int i = 0; i < 10; ++i)
????cout << v[i] << " ";
????cout << endl;
????cout << "????AVL??trre1: " << endl;
????for(int i = 0; i < 10; ++i)
????tree.insert(v[i]);
????tree.insert(13);
????tree.insert(12);
????tree.insert(11);
????tree.lessOrderPrintTree();
????tree.biggerOrderPrintTree();
????AvlTree<int> tree2;
????cout << "????AVL??trre2: " << endl;
????for(int i = 1; i < 8; ++i)
????tree2.insert(i);
????tree2.insert(16);
????tree2.insert(15);
????tree2.lessOrderPrintTree();
????tree2.biggerOrderPrintTree();
????int min = tree2.findMin();
????cout << "min = " << min << endl;
????int max = tree2.findMax();
????cout << "max = " << max << endl;
????return 0;
????}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????