//main.cpp
#include "BST.h"
int main()
{
std::vectorvec = { 8,6,2,5,1,3,7 };
BST bst(vec);
bst.Delete(9);//Not found
bst.Insert(4);
bool found=bst.search(4);
if (!found)
std::cout << "not found" << std::endl;
else
std::cout << "found!" << std::endl;
std::vectorresult;
bst.InorderTraversal(result);
std::cout << std::endl;
for (int i = 0; i < result.size(); i++)
{
std::cout << result[i] << " ";
}
std::cout << std::endl;
system("pause");
return 0;
}
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-32407-3.html
解救股灾被套资金