Find Jobs
Hire Freelancers

Binary tree in Java

$10-30 USD

进行中
已发布大约 9 年前

$10-30 USD

货到付款
Data Abstraction and Problem Solving with Java 3rd Edition book name Implementation: Adapt the following classes from the textbook to have private data members and the needed getters and setters where necessary: TreeNode<T> TreeException BinaryTreeBasis<T> BinaryTree<T> TreeIterator<T> KeyedItem<KT> BinarySearchTree<T> Add the following methods to the BinaryTreeBasis<T> class: public int treeHeight() // This method returns the height of the tree. public boolean isBalanced() // This method returns true if the tree is balanced, false otherwise. public void balanceTree() // This method should balance the tree if necessary. Create a Person class that extends KeyedItem<KT> and contains the following information: private String name // Will be used as the Search Key. private String phoneNumber // Format xxx-xxx-xxxx, where every x is in the range 0-9. The Person class should Override the following methods inherited from the Object class: public boolean equals(Object obj) public String toString() In addition, the Person class should implement the Comparable interface. Test Cases: Your driver program should do the following things 10 times: Create 131,071 contacts, with randomly generated name and phoneNumber data items. Save all your randomly generated contacts in a Vector<Person>. Measure the run times for the following test cases: Insert all your Person entries in the BinarySearchTree<Person>. Search your BinarySearchTree<Person> for all the Person entries in your Vector<Person>. Use the TreeIterator<Person> to display the first 1000 entries using inOrder traversal. Measure and display the height of the BinarySearchTree<Person>. Balance the BinarySearchTree<Person>. Search your BinarySearchTree<Person> for all the Person entries in your Vector<Person>. Use the TreeIterator<Person> to display the first 1000 entries using inOrder traversal Measure and display the height of the BinarySearchTree<Person>. Run all test cases 10 times and make a table with the running time for each run, as well as the average and the standard deviation for each test case. Make sure that you re-create your 100,000 contacts for each test case.
项目 ID: 7480912

关于此项目

1条提案
远程项目
活跃9 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
1威客以均价$55 USD来参与此工作竞标
用户头像
A proposal has not yet been provided
$55 USD 在1天之内
5.0 (94条评论)
5.8
5.8

关于客户

UNITED STATES的国旗
houston, United States
5.0
6
付款方式已验证
会员自3月 18, 2015起

客户认证

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