int main()
{
	BST<int> t;
	
	int a[8] = {30,10,16,35,40,5,33,11};

	for(int i=0; i < 8; i++)
	{
		t.Insert(a[i]);
	}
	t.DisplayInorder();
	cout << endl;

	BST<string> q;
	string days[7] = {"Mon", "Tue", "Wed", "Thr", "Fri", "Sat", "Sun"};


	for(int i=0; i < 7; i++)
	{
		q.Insert(days[i]);
	}

	q.DisplayInorder();
	cout << endl;

	BST<char> r;
	for(char i='A'; i <='K'; i++)
	{
		r.Insert(i);
	}
	r.DisplayInorder();
	cout << endl;
	system("pause");
	return 0;
}
Ejemplo n.º 2
0
int main() {
	BST<int> tree;
	int a[6] = {25, 9, 36, 2, 17, 40};
	for (int i = 0; i < 6; i++) {
		tree.Insert(a[i]);
	}

	cout << "\nInorder Traversal Display: \n";
	tree.DisplayInorder();
	cout << "\n\nPostorder Traversal Display: \n";
	tree.DisplayPostorder();
	cout << "\n\nPreorder Traversal Display: \n";
	tree.DisplayPreorder();
	cout << "\n\nDisplay Leaves only: \n";
	tree.DisplayLeaves();
	cout << "\n\nDisplay Parents only: \n";
	tree.DisplayParent();
 	cout << endl << endl;
	return 0;
}
Ejemplo n.º 3
0
void displayAll(BST<int> B)
{

	cout << "ID\t" << "NAME\t" << "BALANCE\t" << endl;
	B.DisplayInorder();
}