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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic 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