Recursion in binary search trees

Assignment Help JAVA Programming
Reference no: EM13851918

Assignment: Recursion in BSTrees

Recursion in Binary Search Trees

This assignment is intended to give you practice writing recursive code that traverses a common computer programing structure: a binary search tree.

In this assignment you will implement a simple binary search tree using recursive methods: insert, find and remove. These trees are very common to computer science and are typically handled with recursive methods to help attain their intended efficiency.

It is intended that you write this assignment by modifying the answer code from assignment #2. You can use your own answer code or the code we post as answer code as your starting point. We will describe the requirements as though you are modifying the answer code from assignment #2 but you are of course free to start from scratch as well.

1)The TA will open IntelliJ and open your code as an IntellliJ project. (If you compress your code then provide a .zip file only (we will not support .rar, .tar, ... etc.) Only .zip files.

2)The TA will then rebuild (compile) your project and look for a source file among your code with "main" in its file name and then run that as a java application.

3)Once your code launches it will be evaluated against the assignment requirements. If any of steps 1,2 or 3 fail the assignment gets a
mark of 0. So be aware no partial marks will be awarded to assignments that don't compile and run.

Assignments are intentionally broken down into many small requirements. It is better have running code that satisfies some of them than to have code that won't compile and run but claims to be address more requirements.

The following good practice requirements will be in effect for all assignments.

R0.2) All of your variables, methods and classes should have meaningful names that reflect their purpose. Do not follow the convention common in math courses where they say things like: "let x be the number of customers and let y be the number of products...". Instead call your variables numberOfCustomers or numberOfProducts. Your program should not have any variables called "x"unless there is a good reason for them to be called "x". (It's OK to call simple for-loop counters i,j and k etc. when the context is clear and very localized.)

R0.3) All variables in your classes should be private, unless a specific design requirements asks for them to be public (which is unlikely). It is good programming practice to design objects that provide services to others through their public methods.

How they store their variables is their own private business.

R0.4) Robustness Requirements: Your program should never crash when is is being run for marking. Make sure you have no null pointer exceptions or attempt to access an array or data structure out of bounds. (We get especially annoyed by out of bounds errors since they still seem to be the number one bug in programming and have been for a long long time!)

R0.5) Code Comment Requirements: Comments in your code must coincide with what the code actually does. It is a very common bug in industry for people to modify code and forget to modify the comments and so you end up with comments that say one thing and code that actually does another. By the way, try not to over-comment your code; instead choose good variable names and method names which make the code more "self commenting".

R0.6) Hard Coded Constants: Your code should not have hard coded constants used in places like if statements or function parameters. Your constants should have meaningful names. Don't have if statements like if(ball.getLocationX() + 40 < 100) ...; instead your code should look like if(ball.getLocationX() + ballRadius < rightBoundaryX) ...; If necssary create local variables that reflect the use of the constant. e.g. double rightBoundaryX = 100; then you can refer to that in your program logic.


Attachment:- java.zip

Reference no: EM13851918

Questions Cloud

Expressions for entropy change : 1.) Derive the cat constant temperature, constant volume and constant pressure.  Note: These are three separate expressions.
Two commodities and a consumer prefers : Suppose that there are two commodities and a consumer prefers more to less of each good. If the consumer has transitive preferences, can her indifference curves cross?
What is the price elasticity of demand for labor : When the wage rate rose from $6.25 per hour to $6.75 per hour, employment in Fast food, Inc. fell from 5,100 to 4,900. What is the price elasticity of demand for labor?
What would be the best choice for the max corporation : Max Corporation has $10,000 in retained earnings that it has not distributed to its stockholders as dividends. It has a choice to invest the funds in a certificate of deposit at a bank at a guaranteed rate of 7 percent, or to plow back the funds in t..
Recursion in binary search trees : Assignment is intended to give you practice writing recursive code that traverses a common computer programing structure: a binary search tree.
Standby tickets cover average costs of extra passengers : Leopold Bus Company runs daily service between Bigcity and Tinytown. It calculates that the average cost per trip (wages, gas, insurance, payments on loans, etc.) is $140. Leopold sells the bus tickets for $5 each. Will the sales of the standby ticke..
Texaco provides labor-management training : 1. What do these new supervisors need to know about labor relations and the collective bargaining process
Calculate the concentration of all ions : Problem: Calculate the concentration of all ions present in each of the following solutions of strong electrolytes.
What minimum increase in sales would be necessary : Artsy T-Shirts sells 100,000 shirts a year, priced at $14 each. The company can produce any number of shirts at a constant cost of $10 each. It is considering expanding its sales by lowering the price to $12. What minimum increase in sales would be n..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java servlet uses doget to return markup document

Write down Java servlet which uses doGet to return markup document which provides your name, e-mail address, and mailing address along with a brief autobiography.

  List data structures to be used in solution

write a program that will prompt the user for an input file name to read from. The Input file will consist of records made up of first name, last name and an account balance of individuals and store the individuals in an ArrayList.

  How are data structures managed and organized in language

How are data structures managed and organized in this language. How does the management or syntax of data structures in this language differ from how data structures are handled in other language

  Create a class that uses the genetricstack class

Create a new class named GenericStack that specifies a type variable that gives for generics - Use the peek method to return the first item and show that item, and use the size method to return the number of items again and show that value.

  Encrypt and decrypt the message using caesar cipher

Encrypt and decrypt the message using Caesar cipher

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  What is the relationship between an exception and signaling

What is the relationship between an exception, signaling and an exception handler

  Implement the getperimeter that returns the perimeter

Design a class named Triangle that extends GeometricObject. The class contains three double data fields named side1, side2, and side3 with default values 1.0 to denote three sides of the triangle. Implement the getPerimeter that returns the perim..

  Write a program in java to repeat hello world

Write a program in Java to repeat Hello World 10 times. What is JVM (Java Virtual Machine)

  Die class that can hold an integer

Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive

  A method and using a synchronizedblock

What'sthe difference between synchronizing on a method and using a synchronizedblock?

  Make a program that show the sales amount

You have to make a program that show the sales amount. Be sure to include comments. Comments should be included in the program to explain your calculations and 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