Find Jobs
Hire Freelancers

Non-recursive Binary Tree Traversal Program in Java

$30-250 USD

In Progress
Posted about 11 years ago

$30-250 USD

Paid on delivery
I need a program written in java, that outputs the result using console not a GUI, it must meet the following requirements: The program must allow to traverse a binary tree which is created using n ramdom elements, allowing to print the methods "inorder", "preorder", and "postorder". It can be made using stacks, linked list stacks, nodes, or whatever other method you prefer. The traversals should have two variations, one using "for loops", and another using "while loops". for a total of 6 nonrecursive methods: inorderWhileLoop preorderWhileLoop postorderWhileLoop inorderForeLoop preorderForLoop postorderForLoop The binary tree should be created using "n" number of random elements, number which is asked to the user at very run of the program. The program should be fully commented, and documented so I can understand how it works, should be written using Netbeans IDE 7.3 and the latest JDK. I will provide a working program which has the recursive methods implemented and console menu, creates the binary tree and prints the recursive methods. Here is the current output: ========================================== | BINARY TREES | ========================================== | Create a binary tree using n random numbers. | | Choose an Option | | Options: | | 1. While Loop - recursive | | 2. For Loop - recursive | ========================================== Select an option: 1 Option 1 selected While Loop - recursive Enter the total number of random elements: 12 92 11 65 98 42 75 29 35 73 31 93 81 Inorder. 11 -> 29 -> 31 -> 35 -> 42 -> 65 -> 73 -> 75 -> 81 -> 92 -> 93 -> 98 -> ***************** Preorder. 92 -> 11 -> 65 -> 42 -> 29 -> 35 -> 31 -> 75 -> 73 -> 81 -> 98 -> 93 -> ***************** Postorder. 31 -> 35 -> 29 -> 42 -> 73 -> 81 -> 75 -> 65 -> 11 -> 93 -> 98 -> 92 -> _______________________________________________________________________________________ The desired output would be ========================================== | BINARY TREES | ========================================== | Create a binary tree using n random number. | | Choose an Option | | 1. While Loop - recursive | | 2. For Loop - recursive | | 3. While Loop - non-recursive | | 4. For Loop - non-recursive | ========================================== Select an option: 3 Option 3 selected While Loop - non-recursive Enter the total number of random elements to create the binary tree with: 12 92 11 65 98 42 75 29 35 73 31 93 81 Inorder. 11 -> 29 -> 31 -> 35 -> 42 -> 65 -> 73 -> 75 -> 81 -> 92 -> 93 -> 98 -> ***************** Preorder. 92 -> 11 -> 65 -> 42 -> 29 -> 35 -> 31 -> 75 -> 73 -> 81 -> 98 -> 93 -> ***************** Postorder. 31 -> 35 -> 29 -> 42 -> 73 -> 81 -> 75 -> 65 -> 11 -> 93 -> 98 -> 92 ->
Project ID: 4433393

About the project

2 proposals
Remote project
Active 11 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
Hi, I have experience with JAVA and data structures. Let me help you. I am ready to start.
$70 USD in 3 days
5.0 (12 reviews)
3.9
3.9
2 freelancers are bidding on average $77 USD for this job
User Avatar
Please check your inbox. Thanks
$84 USD in 1 day
4.6 (64 reviews)
5.8
5.8

About the client

Flag of COLOMBIA
Boca Raton, Colombia
5.0
6
Payment method verified
Member since Apr 27, 2010

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.