Find Jobs
Hire Freelancers

Non-recursive Binary Tree Traversal Program in Java

$30-250 USD

进行中
已发布大约 11 年前

$30-250 USD

货到付款
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 ->
项目 ID: 4433393

关于此项目

2提案
远程项目
活跃11 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi, I have experience with JAVA and data structures. Let me help you. I am ready to start.
$70 USD 在3天之内
5.0 (12条评论)
3.9
3.9
2威客以平均价$77 USD来参与此工作竞价
用户头像
Please check your inbox. Thanks
$84 USD 在1天之内
4.6 (64条评论)
5.8
5.8

关于客户

COLOMBIA的国旗
Boca Raton, Colombia
5.0
6
付款方式已验证
会员自4月 27, 2010起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。