Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92522422
  • Price:- $55

Priced at Now at $55, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Serializationdesign a verilog module to convert a 64-bit

Serialization Design a Verilog module to convert a 64-bit data signal with periodic timing (eight-cycle period) into a series of eight-bit signals with periodic timing (one-cycle period). You must store the input data, a ...

Question 1 emergency operations- a major hurricane has

Question 1: Emergency operations - A major hurricane has struck the area where your company has its central data center. There are offsite backups and hardware at three other centers around the country. - Assume that the ...

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

Uranium vi fluoride is crucial for the enrichment of

Uranium (VI) fluoride is crucial for the enrichment of weapons-grade uranium. If a 1.0 mol sample of helium effuses in 255 s, how many seconds will it take for the same amount of uranium (VI) fluoride to effuse under the ...

Question suppose you wanted to delete the trash of all

Question : Suppose you wanted to delete the trash of all users just tonight at 11pm using the just created /root/deleteTrash.bash script. Assuming that the deleteTrash.bsh script which deletes the trash of all users exis ...

A string in c is simply an array of characters with the

A string in C++ is simply an array of characters with the null character(\0) used to mark the end of the string. C++ provides a set of string handling function in as well as I/O functions in . With the addition of the ST ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Please tell me about planning and installing a wireless

Please tell me about Planning and Installing a Wireless Network

Assignmentthe rebel alliance has secretly been linking

Assignment The Rebel Alliance has secretly been linking planets together via a series of unstable wormholes to enable escape from the Imperial Fleet. The following table lists the wormholes together with the number of pe ...

Given an undirected graph with both positive and negative

Given an undirected graph with both positive and negative edge weights, design an algorithm to find a maximum spanning forest with the largest total edge weights.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As