Ask Essay Expert


Home >> Essay

Create an abridged binary tree that contains a bNode class that describes a single node of a binary tree, and a bTree class that uses bNode object to define the object binary tree with all of its features.

Project requirements: Your program should contain two objects with the following criteria: An object named bNode that describes a single node in the binary tree. The bNode object should contain a default constructor.

The bNode object should contain an alternate constructor that initializes the objects content variable. All instance variables should be private. Should make proper use of getters and setters.

An object named bTree that utilizes bNode object in order to define a binary tree. Should contain a default constructor. Should contain an alternate constructor bTree(int[] anArray) that allows the user to create a bTree from an array in a depth-first fashion. Should contain an void add(int value, int depth, int number) method that inserts a node to the position depth, number with a value of value. If that path of the tree is not populated (a degenerate tree), then the node should be inserted as the first valid item in the path to the selected node. Should contain an int remove(int depth, int number) method If the node does not exist, then do nothing and return a value of -1 (this is not meaningful, but for now should suffice). Should contain boolean contains(int value) method. Should contain an int get(int depth, int number) method. If node does not exist, then return -

1. Should contain an int indexOf(int value) method Returns the index (node number) of the first occurrence of value Should contain a void print(String traversal) method that prints all elements of the bTree based on the traversal method in one row delimited by one space.

The argumenttraversal may be one of the following three: preorder, inorder, or postorder.

Essay, Writing

  • Category:- Essay
  • Reference No.:- M91098117

Have any Question?


Related Questions in Essay

This essay is a critical review of a journal article about

This essay is a critical review of a journal article about U.S. infrastructure, and it cannot be older than five years. It must be at least five (5) pages of narrative, exclusive of all other supporting material. Include ...

The requirement for this assignment is to conduct a risk

The requirement for this assignment is to conduct a risk assessment of a real or fictional facility or building. There are two models described in your Course Resource section (modules) which is in Course Content, and I ...

Interview paper - instructionsgendered communications in

Interview Paper - Instructions Gendered Communications In this paper, you will analyze a specific topic that pertains to gendered communication within educational settings, the workplace, or the media. You will interview ...

Write a 400-word analysis that includes1 the role of the

Write a 400-word analysis that includes: 1. The role of the principal in enforcing school, teacher, and student-related policies. 2. Legal consequences for failing to enforce these policies. 3. How the principal enacts p ...

Career speechyou are to pick a career path that you might

Career Speech You are to pick a career path that you might be thinking about going into or that you know you are pursuing, then give a speech about it. If you have no idea as to what career path you might take, this is a ...

Detailssocial media channels are designed to be engaging

Details: Social media channels are designed to be engaging; however, these media are often used by public health organizations and practitioners as a means to disseminate mass information, rather than to engage audiences ...

You need to prepare a three page essay double spaced with 4

You need to prepare a three page essay, double spaced, with 4 cited references on the topic "How can robotics help the accounting field?" Article - Emerging Trends of Robotics in Accounting by Kasthuri Henry

Describe the thematic unity of the present arrangement of

Describe the thematic unity of the present arrangement of the twenty seven books of the New Testament. Do you see an overriding design that gives this anthology an effective structure?

You need to write a 500 word essay on workplace diversity

You need to write a 500 word essay on workplace diversity and the affects it have on the community. This should include at least 1 reference.

Assignment -write an essay of 2500 words on only one of the

Assignment - Write an essay of 2500 words on only ONE of the following topics: 1) Is euthanasia ever morally justified in your view? If so why and under what conditions? If not, why not? 2) Under what circumstances, if a ...

  • 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