Create a red-black tree which supports only the operations

Assignment Help Computer Engineering
Reference no: EM132169213

USING JAVA:

You are to create a red-black tree which supports only the operations listed below. All operations should have time complexity O(log n) when there are n items in the tree, this is the guarantee that red-black trees give. The class should be derived from the TreeMap class in java.util

The only operations which this class supports are:

public boolean is Empty()

public void makeEmpty()

public void insert(Comparable x) throws DuplicateItem

public void delete(Comparable x) throws ItemNotFound

public void deleteMin() throws ItemNotFound

public void deleteMax() throws ItemNotFound

public Object find(Comparable x) throws ItemNotFound

public Object findMin() throws ItemNotFound

public Object findMax() throws ItemNotFound

Your class should be named RBTree

Notes

In no particular order

TreeMap expects Object and the requirement for RBTree is Comparable

TreeMap doesn't throw any reasonable checked exceptions. Your RBTree class does.

TreeMap expects to perform a mapping of keys to data. RBTree doesn't. You may find this to present a problem if you're not careful in the way you implement some of the methods.

The methods in the above list are the only methods that RBTree supports.

Reference no: EM132169213

Questions Cloud

Allow the user to toggle a checkbox for case sensitivity : Using HTML, CSS, and JavaScript, Input a user-specified text file (i.e., one with suffix .txt) and display it in a scrollable textbox.
Create a comparison spreadsheet to compare the systems : Create a comparison spreadsheet to compare the different systems. Compare at least 5 different IDPS. Be sure and state the source of your information.
Create an order form for the three items you used : Provide at least the choices Visa, MasterCard and American Express. Each form element, not just payment, must have an associated element.
Draw your initials 100 pixels high : Draw a rectangle as a Rectangle and as a Polygon. Make the lines of the Polygon yellow and the lines of the Rectangle green.
Create a red-black tree which supports only the operations : Create a red-black tree which supports only the operations listed below. All operations should have time complexity O(n).
Write some code that asks the user to enter an integer : Write some code that asks the user to enter an integer via the keyboard, use that integer to set the length of an array.
Write an application that creates objects of each : Using interfaces, as you learned in this chapter, you can specify similar behaviors for possibly disparate classes.
Create a gui application that allows the user to enter : Create a GUI application that allows the user to enter the total sales for the month into a text field.
Create a personal set of web pages on any topic : Create a personal set of Web pages on any topic that you like. Use CSS to provide a consistent style to your pages.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are several reasons why planning ahead may have helped

The rapid development face-off was a competition between rapid application development (RAD) teams from the leading consulting firms in the United States. What are several reasons why planning ahead may have helped E&Y win?

  Write down program for a bank account

Write down program for a bank account

  How to defend against attacker on the web

Even just talking on the phone can be a security risk, according to Harwood, there will be a slight increase in risk due to all the vulnerabilities

  List what might be done to provide fault tolerance

Search for information on system and equipment failure on your favorite search engine. List what might be done to provide fault tolerance for a single system.

  When the user presses the start button

When the user presses the start button, a menu display of potential destinations is activated along with a message to user to choose a destination.

  Write a program that inputs several lines of text

Write a program that inputs several lines of text and a search character and uses function strchr to determine the total occurrences of the character in the lines of text.

  Optimum solution of the reddy mikks model

Determine the solution space and the optimum solution of the Reddy Mikks model for each of the subsequent independent changes and employ the graphical approach.

  What was the human reason for encoding this information

What kind of encoding would this be and what was the human reason for encoding this information?

  Discuss the changes that were necessary

Nazca Cinemas is a small movie theater that would like you to create a movie scheduling database system for them. The theater has four rooms (screens).

  Why program objectives needs to be defined

Why Program Objectives needs to be defined in details prior to program and Project Plan? Clarify the statement with proper explanation.

  Explore the effectiveness of this technique for task

Analyze your approach to problem giving estimates of its time and space requirements. Also, critically explore the effectiveness of this technique for this task.

  List and describe the ways to backup the registry

Describe the Windows kernel, including its two main components and list and describe the ways to backup the registry.

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