Prepare a program that constructs a binary tree

Assignment Help JAVA Programming
Reference no: EM134266

Prepare a program that constructs a binary tree and traverses the tree in pre-order, in-order and post-order methods. Your program must also give the height of the tree. Your program must implement proper object oriented and data structure basic concepts (use interfaces and implement the required primitive operations).

The input must be read from a file. Suppose the nodes store positive numbers and have no duplicates. On every line of input file specify the node, its parent, its left child, and right child. A -1 must be used to show absence of a parent, left child, or right child. Below are some examples of sample input line with explanation:

0 -1 1 2 #Node stores 0 with no parent and has left child and right child that stores values 1 and 2.

1 0 3 4 #Node that stores 0 is parent of 1 and nodes left and right child store 3 and 4.

Here is sample text that must be in your input file

0 -1 1 2
1 0 3 4
2 0 5 6

Write your own implementation of primitive operations and use self-referential classes in your implementation.

Make sure your code runs from command line and specify which version of java was used along with the commands to compile and run your code. Failure to properly document your code will result in penalty.

Also make sure you upload a compressed version of your folder, please use .zip compression format. Your folder must contain only the java source files, please do not include any other kind of files such as jar files, class files, any input text files etc.

Your assignment will be graded based on following structure:

1. Implementation of data structure
2. Implementation of traversal techniques
3. Implementation of finding the height of tree
4. Documentation and indentation

Reference no: EM134266

Questions Cloud

What is the least time necessary for crossing : What is the least time necessary for crossing
What is emf in the secondary circuit : What is EMF in the secondary circuit
What is new angular speed of the merry-go-round : What is new angular speed of the merry-go-round
What is fraction of the diameter of the sun : What is fraction of the diameter of the Sun
Prepare a program that constructs a binary tree : Write your own implementation of primitive operations and use self-referential classes in your implementation.
What is frequency of the rotational motion for the wheel : What is frequency of the rotational motion for the wheel
What is an angular acceleration : What is an angular acceleration
An analysis of the revised project : Evaluate the project in light of this new information
What is modify in frequency ff - fi : What is modify in frequency ff - fi

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Implementation activities of software development

Analysis, design, and implementation activities of software development

  Mean and standard deviation using using eclipse

Java programming to calculate Mean and standard deviation using Using Eclipse.

  Design and implement a small and simple email server

Design and implement a small and simple email server

  Data structures and algorithms

Code analysis and programming.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Write a java program in a netbeans project

Write a Java program in a NetBeans project

  World data app

Prepare WorldDataApp project. It implements the NameIndex portion, including creating it in SetupProgram, and searching, viewing and updating it in UserApp program.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd