| | |
Abt Binary Search Trees
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
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 ...
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 ...
C++ Syntax (Toggle Plain Text)
#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(); }
0
#2 Oct 17th, 2009
Unfortunately you havn't done enough to make us help u... you can find out a lot of material about tree traversal here, infact you can see similar threads at the bottom of this page too. Read them and you should be able to do a lot more than this. Post your code then if you face any issues.
thanks
-chandra
-chandra
![]() |
Similar Threads
- binary search trees (Java)
- Great Binary Search Program, Unable to Output to File. Please Help! (C++)
- Binary Search Trees - Need Help Indicating Node Level (C++)
- binary search trees (Computer Science)
- please help me: build a binary search tree by Lisp (Legacy and Other Languages)
- Binary search tree removal (C++)
Other Threads in the C++ Forum
- Previous Thread: Creating ouput files dynamically - (File I/O)
- Next Thread: ConvertToInt32 problem
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





