QuestionQuestion

You need to extend IntLinkedBinaryTree, which you wrote for Homework 3, in the following way:
(1). Implement a delete method whose specification is given below: Signature: public Integer delete(Position<Integer> p, Integer e)
Input:
p: the root of the tree from which a node is deleted
e: the integer key of the node to be deleted
Output: Returns the deleted key, if e exists. If e does not exist, returns null.
(2). Make your program a menu driven program. When your program starts, it must display the following main menu:
Choose an option:
1.Add a key
2.Remove a key
3.Print the tree
4.Exit If the user chooses option 1, your program performs the followings:
Prompt the user to enter an integer.
If the integer does not exist in the tree, add the integer and display an appropriate message, such as “the key added successfully,” and display the main menu.
If the integer already exists, display an appropriate message, such as “the key already exists,” and display the main menu.
If the user chooses option 2, your program performs the followings:
- Prompt the user to enter an integer.
- If the integer does not exist in the tree, display an appropriate message, such as “the key does not exist,” and display the main menu.
- If the integer exists, display an appropriate message, such as “the key deleted successfully,” and display the main menu.
- If the user chooses option 3, display all keys in the tree in increasing order, and display the main menu.
- If the user chooses option 4, terminate a program.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

I. Design Goals
To implement this software system, the classes which will make up the ShopPal App will be divided up into packages to modularize the functionality of the overall system. This will be key for dividing up the overall intended functionality of the program, allowing the software designers to architect the system in pieces, focusing on specialized tasks. The code will be divided up into three categories:
1. Code which represents to the store itself, to keep track of and maintain store details, store inventory, items within the store, and so forth. This code will be persistent to the store, independent of the application and of user activity.
2. Code which relates to the application and what will be displayed/presented in the ShopPal app, independent of the store and of user activity.
3. Code which...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

$75.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats