Find Jobs
Hire Freelancers

C++ Tree

$10-15 USD

Completed
Posted about 21 years ago

$10-15 USD

Paid on delivery
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 [login to view URL] file and a [login to view URL] file. - Your [login to view URL] 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 [login to view URL] 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
Project ID: 2924671

About the project

4 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$7 USD in 14 days
5.0 (18 reviews)
3.5
3.5
4 freelancers are bidding on average $9 USD for this job
User Avatar
See private message.
$8.50 USD in 14 days
4.6 (148 reviews)
6.1
6.1
User Avatar
See private message.
$12.75 USD in 14 days
5.0 (8 reviews)
3.2
3.2
User Avatar
See private message.
$5.95 USD in 14 days
0.0 (1 review)
0.0
0.0

About the client

Flag of UNITED STATES
United States
5.0
5
Member since Mar 9, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.