You will need a bottomuptwothreefourtree class with a

Assignment Help JAVA Programming
Reference no: EM13346572

You will need a BottomUpTwoThreeFourTree class, with a BottomUpTwoThreeTreeFourTree constructor which takes no parameters.
BottomUpTwoThreeTreeFourTree will need an insert(int x) method, which will insert the value x into your tree. For this tree, duplicate insertions should be discarded. That is, if I insert a value into the tree which is already in the tree, do not change your tree. As discussed in class, if a node needs to split, the value passed up to the parent should be the median value of the three keys in the node, before the 4th key is added.
BottomUpTwoThreeFourTree will need a search(int x) method, which will search for the value x in your tree. The method should return a String, formatted as follows. If the value x is in the tree, it will reside in a node with either one, two, or three keys. For a one key node, the string will just be that node's key as a String. If it is a two key node, the string should be the two values, in increasing order, with a single space between them. Finally, three keys should be returned with a single space between each pair, in increasing order. Example: if we are searching for the number 17, and it is a key alone in a node, the search function should return "17". If it is in a node with 35, you should return "17 35". If it is in a node with 10, you should return "10 17". And, if it in a node with keys 10 and 35, you should return "10 17 35". Note, there is no space after the last key value.
If the value searched for is not in the tree, your search should have terminated at a leaf node. In that case, print the contents of that leaf node, with the same formatting described above. That is, if 17 is not in the tree, and you end in a node that contains keys 18 and 20, return "18 20".
You need to submit your own JUnit tests as well, again in a file with a name ending in Test.java or Tests.java. Your main grade will be based on (a) how well your tests cover your own code, (b) how well your code does on your tests, and (c) how well your code does on MY tests. If you fail even one of my tests, I will set up my tests to make sure that you fail many of them. If you know that your code has an error, it is hard to consider your code as "working"

Reference no: EM13346572

Questions Cloud

Add drop down lists for modifying the different style : add drop down lists for modifying the different style elements for the label element that displays the time.we will do
Report on american express - marketing strategycredit card : report on american express - marketing strategy.credit card industry was in boom before the recessionary phase but due
1 we want to find the integral of a function at an : 1. we want to find the integral of a function at an arbitrary location x from the origin.nbsp thuswhere ix0 is the
Write an essay onnbspwomen and gender : write an essay onnbspwomen and gender studies.introductionnbspthe first reading of gender and bodily difference
You will need a bottomuptwothreefourtree class with a : you will need a bottomuptwothreefourtree class with a bottomuptwothreetreefourtree constructor which takes no
Nbspa solution of 0100 m acetic acid is prepareda what is : nbspa solution of 0.100 m acetic acid is prepared.a what is its ph value? b if 20 of the initial acetic acid is
Lipid rafts provide another example of the complexity of : lipid rafts provide another example of the complexity of cell surfaces in both their structural character and biologic
Please describe how one might search for chemical structure : please describe how one might search for chemical structure biologic function relationships involving small molecular
Lipid metabolites are often seen as key elements in : lipid metabolites are often seen as key elements in cellular signaling. is this unique? please provide several examples

Reviews

Write a Review

JAVA Programming Questions & Answers

  supply a student tester class that tests all methods

Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate constructor and methods getName( ), addQuiz(int score), getTotalScore( ), and getAverageScore ( ).

  Design and implementation of a hangman game

Design and Implementation of a Hangman game

  Recognize one high severity vulnerability for computer

Recognize one high severity vulnerability for each computer (if there is one). Explain vulnerability and describe control(s) to minimize risk from vulnerability.

  Implementation the two classes

Program Specifications: In the new implementation, the two classes, Student and Grades, are defined with the following operations/methods.

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Java program that reads an input

Create a java program that reads an input of n lines with the first line being the number of people in the contest and the remaining lines a numeric 9 digit code for each person that gets a vote

  Java application to generate three-digit random number

Write a Java application that generates a 3-digit random number 100 times. Display the output for each of the generated numbers and the sum of all 100 numbers.

  Write a simple java program that will read an array of info

write a simple java program that will read an array of information containing the information (Name, offence [between arson, assault or theft] and year of offence

  Compilation and Execution - JAVA problem

Style marks are based on how your submitted code looks. Remember that good code is easily readable (and understandable) by someone who did not write it. For assignments, you should also include your name, student number, what course this is, what ass..

  Write a java program that declares an array alpha of 50

Write a Java program that declares an array alpha of 50 elements of type double. Initialize the array so that the first 25 elements are equal to the square of the index variable, and the last 25 elements are equal to three times the index variable. O..

  Construct a bulls and cows program for my intro java class

construct a Bulls and Cows program for my intro Java class. This program needs to perform the basic functions of the game (determining how many cows there are and how many bulls there are and tell the player when they win), but it also needs to offer..

  That uses a library database of books

Write a Java program that uses a library database of books and patron data, as described in Exercise R22.2. Patrons should be able to check out and return books

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