Find Jobs
Hire Freelancers

BinaryTree class

$30-250 USD

Abgeschlossen
Veröffentlicht vor mehr als 9 Jahren

$30-250 USD

Bezahlt bei Lieferung
Add the following methods to the class BinaryTree shown below: public T get(int i) public void add(int i, T element) public T remove(int i) All these methods use the inorder traversal of the tree. Feel free to use helper methods and/or extra fields. Here are the description of what the methods do. --------------------------------------------------------------------------------- get(i) returns the element of the i-th node of the inorder traversal of the tree. If i is outside the range it throws a NOSuchElementException. For example if the inorder traversal of the tree t is a, b, c, d, e, f, g, h, i, j, k [login to view URL](4) returns e. ---------------------------------------------------------------------------------- public void add(int i, T element) inserts element in the tree such that it is the i-th item in the inorder traversal. Throw an index out of bounds exception if i is out of bounds and increase size if the insertion is successful. For example if the inorder traversal of the tree t is a, b, c, d, e, f, g, h, i, j, k after the call [login to view URL](5, x); the inorder traversal of t is a, b, c, d, e, x, f, g, h, i, j, k ----------------------------------------------------------------------------------- public T remove(int i) removes the i-th item of the tree. Throw a no such element exception if i is out of range. Don't forget to decrease the size if the remove is successful. For example if the inorder traversal of the tree t is a, b, c, d, e, f, g, h, i, j, k the call [login to view URL](5); returns f and the inorder traversal of t is a, b, c, d, e, g, h, i, j, k -------------------------------------------------------------------------------------- Here is the class [login to view URL] import [login to view URL]; public class BinaryTree<T> { /** Creates an empty binary tree */ public BinaryTree() { root = null; } // create a binary tree with a given root value public BinaryTree( T rootItem) { root = new BinaryNode( rootItem, null, null); size = 1; } // @return the root of the tree public BinaryNode<T> getRoot() { return root; } // @return the size of the tree public int size() { return size; } // @return the the height of the tree public int height() { return [login to view URL](root); } // print the tree in preorder public void printPreOrder() { if (root != null) [login to view URL](); } // print the tree in postorder public void printPostOrder() { if (root != null) [login to view URL](); } // print the tree in inorder public void printInOrder() { if (root != null) [login to view URL](); } // empty the tree public void makeEmpty() { root = null; size = 0; } // check if the tree is empty public boolean isEmpty() { return root == null; } // forms a new tree from rootItem t1 and t2 // does not allow t1 and t2 to be the same public void merge(T rootItem, BinaryTree<T> t1, BinaryTree<T> t2) { if ([login to view URL] == [login to view URL] && [login to view URL] != null) throw new IllegalArgumentException(); // allocate new node root = new BinaryNode<T>(rootItem, [login to view URL], [login to view URL]); size = [login to view URL]() + [login to view URL]() + 1; // ensures that every node is in one tree if (this != t1) [login to view URL] = null; if ( this != t2) [login to view URL] = null; } private BinaryNode<T> root; private int size = 0; }
Projekt-ID: 6731107

Über das Projekt

18 Vorschläge
Remote Projekt
Aktiv vor 9 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
Hi, I will be able to do this in a day time. Please let me know if you would like me to assist you with this project. We have already done two projects on the same lines. So I would be happy to continue the relationship further.
$50 USD in 1 Tag
4,8 (17 Bewertungen)
4,3
4,3
18 Freelancer bieten im Durchschnitt $49 USD für diesen Auftrag
Avatar des Nutzers
Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my Java and algorithm skills. I am focused mostly on doing computer science work here in freelancer.com and I would like to help you get this project done if you would give me the opportunity. I am a computer science professor and practitioner and this assignment is one of the fields that I teach very well so I can assure you an accurate result. Let me know if you are interested so I can start. Thanks.
$30 USD in 1 Tag
5,0 (1093 Bewertungen)
7,7
7,7
Avatar des Nutzers
HI Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks Farah Saif
$30 USD in 1 Tag
5,0 (514 Bewertungen)
7,4
7,4
Avatar des Nutzers
Hello. I am experienced with Java and I am familiar with Binary Tree data structure very well. It can be done in few hours.
$30 USD in 1 Tag
4,9 (637 Bewertungen)
6,9
6,9
Avatar des Nutzers
Dear sir. I've scrutinized your project description. Because I have mastered "Data structure and Algorithm", I can surely do this very quickly and cleanly. Choose me to have the best one.
$210 USD in 3 Tagen
5,0 (13 Bewertungen)
6,8
6,8
Avatar des Nutzers
I am very proficient in java. I have 12 years java developing experience. I have worked for 5 years, my work is online game developing, and mainly focus on server side, the language is java under linux, I am proficint in c++ also. I used java to make many great projects. For example, I made the tools which can convert PWScript(a script language created by our company) to c++ files. I made our own mobile games, and i am mainly responsible for the server side, and it was built using java. I can even show you the mobile game client. Please let expert help you.
$30 USD in 1 Tag
4,9 (88 Bewertungen)
6,5
6,5
Avatar des Nutzers
Hello. I am interested in your project. I have required skills and experience in Java development including working with data structures. I have completed several projects on this freelancer site and on others resources. All of them were successful. I am able to complete your assignment today and with good quality. Fill free to contact me so we can discuss any details. Thank you for your consideration. Vitalii Oleksiv
$30 USD in 1 Tag
5,0 (37 Bewertungen)
5,8
5,8
Avatar des Nutzers
Hello, I am Java expert. I am willing to help you do this project right now. Please contact me. Thank you
$55 USD in 1 Tag
5,0 (53 Bewertungen)
5,5
5,5
Avatar des Nutzers
Hello, I have 6 years experience in java. I can do this assignment. Please message me for further discussion.
$30 USD in 2 Tagen
4,9 (103 Bewertungen)
5,5
5,5
Avatar des Nutzers
I can do this project, choose me, please :) ..................................................................
$30 USD in 3 Tagen
5,0 (7 Bewertungen)
5,0
5,0
Avatar des Nutzers
hey buddy contact me and I will complete this in less than one hour...you can see my profile my speed and quality for any work is very great
$100 USD in 3 Tagen
5,0 (13 Bewertungen)
3,4
3,4
Avatar des Nutzers
I have read and understand your requirements Please open chat window to discuss further.. ++++++++++++++++++++========================+++++++++++++++++++++++++++++++++++++++++
$30 USD in 1 Tag
4,7 (8 Bewertungen)
3,7
3,7
Avatar des Nutzers
Hello There I am 5 year Java Experienced I will do it for you in very short time , will also add comments if you want to code Thank in advance Hiasat
$30 USD in 1 Tag
5,0 (12 Bewertungen)
3,2
3,2
Avatar des Nutzers
This project is easy. I can make it with clean code, understanding comment :) If you need explanation, I can hold a quick talk via skype if needed (but I got a flu now, please wait for 1-2 days).
$55 USD in 3 Tagen
4,6 (4 Bewertungen)
2,1
2,1
Avatar des Nutzers
Hi sir :)) , i'm a 3 years contestant in ACM ( algorithms and programming contest ) , them i became a coach and judge in the national version , i'm really good in algorithms and java programming , please consider mu bid :))
$30 USD in 0 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
A proposal has not yet been provided
$35 USD in 2 Tagen
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
Dear sir, if you would like to hire me, let me know. I am engineering undergraduate of University of Moratuwa, Sri Lanka. I will support you in my best. Thanks in advance.
$30 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
We are the leading young professional software development organization having extensive technical expertise and knowledge in developing, managing, optimizing and customizing software’s by implementing these software’s in different demanding programming tools and latest technologies especially in ASP,ASP.net,VB,VB.net,Linux, C++, C #, Java, SQL, Access. We have fully studied your project requirements description and also highlight main points in order to perform your demands which is required to complete the project in a given proposed time frame, as our commitment is a key to our successful journey which also inspired our employers who gave us the full rating on our completed projects as a "Project Completion Rate" which is also shown in our profile. Moreover we are also fully committed to accomplish the task assigned by you with the required state of the art technology to fulfill your requirements as prescribed in this project. I thinks that this is the best way to utilize our impressive skills under the light of our previous experiences and excellent reviews given by the employers. We wish to render you our services and hopeful not to let you disappoint. We will also be responsive with a positive gesture without demanding any further cost. We are quite optimistic in a bid to receive this project. Thanks With Best Regards Your Well Wisher Motivated Young Freelancer
$44 USD in 3 Tagen
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von UNITED STATES
cooper city, United States
5,0
6
Zahlungsmethode verifiziert
Mitglied seit Okt. 17, 2014

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.