Create a class for a binary tree named bt

Assignment Help Data Structure & Algorithms
Reference no: EM131713730

Assignment

Create a class for a binary tree named BT. Each node in the tree should have data, a reference to the node's left sub-tree, and a reference to the node's right sub-tree. For the purposes of this project, the data in the nodes can be integers.

The binary tree should have a height property, a size property, which is the number of nodes in the tree, and the following methods:

1. a null constructor

2. a constructor that builds a tree from a specified array of integers. The tree does not need to be a balanced tree.

Note: remember to address the height and size properties when building a tree from a specified array.

1. preorder -- iterate ( list all nodes in order according to the preorder traversal of the tree)
2. inorder -- iterate ( list all nodes in order according to the inorder traversal of the tree)
3. postorder -- iterate ( list all nodes in order according to the postorder traversal of the tree)
4. search -- given a key value, tell us whether or not the integer is in the tree.
5. max -- return the maximum value in the tree
6. min -- return the minimum value in the tree
7. insert
8. delete
9. destroy

Test each method to ensure that it works properly.

Reference no: EM131713730

Questions Cloud

What are the barriers to change our healthcare system : What are the barriers to change our healthcare system from a curative approach to a preventative one
Problems faced by immigrants : Just as today, the late 19th and early 20th century witnessed a huge wave of immigration. Are there similarities in the problems faced by immigrants?
Themes relative to the civilizations : "Egyptian Culture "What is the importance of these themes relative to the civilizations at the time? How do these themes manifest themselves in works of art?
Discuss the inquisitors interrogation of veronese : Do you agree with the Inquisitor's interrogation of Veronese about his painting, originally titled Last Supper
Create a class for a binary tree named bt : Create a class for a binary tree named BT. Each node in tree should have data, a reference to node's left sub-tree and a reference to the node's right sub-tree.
What were the main things europeans wanted : In Southern Africa, what were the main things Europeans wanted? How did they make Africans work for them?
Discuss with respect to change agents : With respect to change agents, should organizations use internal or external change agents
What did british colonialism do with the benin bronzes : What did British colonialism do with the Benin Bronzes? What did Queen Elizabeth do with the Benin Bronzes?
How do our institutions affect economic activity : Identify authoritative academic, governmental, advocacy group, and media resources - Evaluate the quality of resources

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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