Consider the binary search tree

Assignment Help JAVA Programming
Reference no: EM13942156

Questions:

a. Consider the following binary search tree:

2386_tre.png


i. What tree results after you insert the nodes 44, 48, 32, 36, 38, and 49 in that order? You only need to show the final result.

ii. Given the original tree, what tree results when you delete the node 43 and then node 50? (Note: there may be more than one correct answer, but please choose only one).

a. If you delete an item from a binary search tree and then immediately insert it back into the tree, will you always end up with the same tree? Briefly justify your answer.

b. Suppose that we have a set of unique numbers between 1 and 1000 in a binary search tree and want to search for the number 363. Which of the following sequences could not be the sequence of nodes examined? Only explain the invalid cases (no need to explain the others).
i. 2, 252, 401, 398, 330, 344, 397, 363

ii. 924, 220, 911, 244, 898, 258, 362, 363

iii. 925, 202, 911, 240, 912, 245, 363

iv. 2, 399, 387, 219, 266, 382, 381, 278, 363

v. 935, 278, 347, 621, 299, 392, 358, 363

c.Write the following method which tests if a BinaryTree is a binary search tree. Assume this method exists in the BinaryTree class. Note: Empty binary trees should also be considered to be binary search trees.
public boolean isBinarySearchTree()
// post: returns true iff this is a binary search tree

 

Reference no: EM13942156

Questions Cloud

Explain the role of the family in the iep process : Review the article from the National Dissemination Center for Children with Disabilities (NICHCY), "Contents of the IEP." Summarize these components and explain the purpose and importance of the IEP in supporting the student's educational outcomes.
Find a data source that involves two variables of interest : Modify the RQ to match the available data. The RQ is What is the relationship between number of hours spent in an afterschool program and level of aggression for African American males ages 17?
Assignments is there an evidence of desperate impact : Assignments is there an evidence of desperate impact against African Americans in the decision that were made?on what basis do you arrive at this position?illusterate how he "80 percent rule"can be used with the data and whether there was violation o..
Estimate the equilibrium temperature : Estimate the equilibrium temperature of each plate assuming they are diffuse and that the solar flux is 1368 W/m2. The spectral absorptivity of the black painted surface can be approximated
Consider the binary search tree : What tree results after you insert the nodes 44, 48, 32, 36, 38, and 49 in that order? You only need to show the final result.
Inspector from the department of weights and measures : A random sample of 450 shoppers at Quincy Mall found that 150 favored longer shopping hours. Is this sufficient evidence to conclude that less than 30% of the shoppers at Quincy Mall favor longer hours?
Intended audience of the press release : Who do you think is the intended audience of the press release? Do you think the company effectively communicated to its audience base? Why or why not?
Should marijuana be legal in all states for cancer patients : Should marijuana be legal in all states for cancer patients? Is Chemotherapy a good or bad thing for cancer patients?
Differences between formal and informal research : Write a paper that describes the differences between formal and informal research. What are the benefits and the drawbacks? Provide examples of when might you use each type of research

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