C++ Tree

Recursion may be used througout On the next page of this handout is a tree.h file. Your project will contain this file plus two others: a [url removed, login to view] file and a [url removed, login to view] file. - Your [url removed, login to view] file will contain the implementations for the files that are prototyped in the tree.h file. 1. AddToOrderedList( ) adds the second parameter to the list in order. 2. PrintList() prints the entire list from the first node to the end node. 3. MakeBalancedTree ( ) creates a new balanced binary tree which will be pointed to by the second parameter, using the data from the ordered linked list (pointed to by the first parameter) whose length is the third parameter. 4. CountList() returns the number of nodes in the list. 5. PrintTree() outputs the data in the tree using an inorder traversal. 6. Depth() returns the depth of the tree. Your [url removed, login to view] file contains a main() function. Your main() should: 1. create an empty linked list and an empty tree. 2. prompt the user for integers (zero when done). 3. add the integers to the linked list in order. 4. print the list. 5. make a balanced binary search tree from the data in the ordered linked list. 6. print the tree in order. 7. find and output the depth of the tree. 8. print the linked list again to make sure you did not alter it. //tree.h #include #include struct ListNode { int data; ListNode* linl; }; struct TreeNode { int data; TreeNode* left; TreeNode* right; }; void AddToOrderedList(ListNode* & head,int x); void PrintList(ListNode* head); void MakeBalancedTree(ListNode* head,TreeNode*& root,int count); int CountList(ListNode* head); void PrintTree(TreeNode* root); int Depth(TreeNode*root);

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.

## Platform

MS VISUAL C++ Windows ME

Kemahiran: Pengaturcaraan C, Kejuruteraan, MySQL, PHP, Kejuruteraan Perisian, Ujian Perisian

Lihat lagi: visual c++ programming, tree programming, tree node, tree in order, tree binary search, struct in cpp, struct c programming, struct cpp, source code for binary search in c, search in tree, search in binary tree, search binary tree, search binary search tree, search binary, search a tree, recursion programming, recursion in programming, recursion function, program of binary search in c, programming tree

Tentang Majikan:
( 5 ulasan ) United States

ID Projek: #2924671

Dianugerahkan kepada:


See private message.

$7 USD dalam 14 hari
(18 Ulasan)

4 pekerja bebas membida secara purata $9 untuk pekerjaan ini


See private message.

$8.5 USD dalam 14 hari
(148 Ulasan)

See private message.

$12.75 USD dalam 14 hari
(8 Ulasan)

See private message.

$5.95 USD dalam 14 hari
(1 Ulasan)