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

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Method to calculate all primes in the range [2..n]

One commonly used method to calculate all primes in the range [2..n] is to start with the number 2, mark it as prime, and mark all its multiples (excluding itself) as not prime. Then, we find the next smallest unmarked number, mark it as prime, and m..

  Create a java application

Create a Java application named DistanceCalculator.java to solve the following problem. An application is needed to allow a user to enter two cities and display the distances between them.

  Create a new savings account

You are a bank manager and you are helping a new bank teller understand the kind of accounts the bank offers. If a customer comes in asking to open a new savings account, the teller needs to ask what kind of account-passbook savings or certificate..

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  Write a short java application

You will write a short Java application that will accept five strings from the user. Each String will be a word in a sentence.

  Demonstrate how the quicksort algorithm behaves

Demonstrate how the quicksort algorithm behaves. You will be implementing quicksort, but in a way that allows the program's user to visually observe how the algorithm proceeds by watching animated colored bars.

  Ask the user to input a grade (integer from 1-100)

Program should still ask the user to input a grade (integer from 1-100) and then output the letter grade.  Scale:  Greater than 90 is an "A"; Greater than 80 to 90 is a "B", Greater than 70 to 80 is a "C", Greater than 60 to 70 is a "D", and 60 or le..

  Calculate and display the mortgage payment amount

Change request7RequestorNinfa Pendleton - Rapid City, SDDescriptionWrite the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage

  Application that simulates a cash register

Implement a graphical application that simulates a cash register. Provide a text field for the item price and two buttons for adding the item to the sale, one for taxable items and one for nontaxable items. In a text area, display the register tap..

  Write the method in java

2.char mostOftenIn(String s) that for a given string s, returns the character that occurs most often in s.

  How do you provide a link from one class to a related class

How do you provide a link from one class to a related class

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