Write a program that will allow randomized 0..100 numbers and the 15 generated numbers will serve as the input to ur binary search tree. The program should then print out the contents of your BST using preorder, inorder, and postorder traversals, store the result in the text file ( bst.txt)Recall the convention to place any duplicate number in the left subtree of that letter.
So far ive only done the randomize process... help me do the other parts...please any idea will help... or if you give the code much better,,,
Thx ...
#include<stdlib.h>
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
srand((unsigned)time(0));
int random_integer = rand();
for(int index=0; index<15; index++) {
random_integer = (rand()%100)+1;
cout << random_integer << endl;
}
getch();
}