Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***PLEASE USE JAVA*** Building a 2-3 Tree In this assignment, you will be implementing a 2-3 tree to handle the DVD database of a video

***PLEASE USE JAVA***

Building a 2-3 Tree In this assignment, you will be implementing a 2-3 tree to handle the DVD database of a video store. A 2-3 tree is a tree satisfying the following requirements All internal nodes in the tree have either two or three children. All leaves of the tree are at the same level. In this assignment, Nodes will store the titles of the DVDs. The title will be stored as a string and titles may consist of multiple words. Your application should include AT LEAST the following functions for your 2-3 tree. Print the tree in the following manners. When printing a value, print the string followed by a , and 1 space. You must follow these guidelines exactly! For example: Aliens, The Lord of the Rings, Kill Bill, o void preOrder ( ) - Traverse and print the tree in preorder notation following the printing guidelines specified above. o void inOrder ( ) - Traverse and print the tree in inorder notation following the printing guidelines specified above. void insert ( string ) - Insert an item into the 2-3 tree. Be sure to maintain the 2-3 tree properties. void remove ( string ) - Remove a specified item from the tree. Be sure to maintain the 2-3 tree properties. Some removes can be resolved in multiple ways. (This is optional) search ( string ) - Search for a specified item in the tree. Return a pointer to the node containing the item if the time exists in the tree. Return null if the item does not exist. Your main method should provide prompts to ask user to insert new DVD titles, search for one particular DVD, and print out all the DVD you have in the database (sorted Inorder, or not sorted pre-order). Hints: Your node class could be implemented as below for your convenience only: 2 class Node { private string small; private string large; Node left; Node middle; Node right; Node parent; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics Systems Engineering Cybersecurity Project Management

Authors: Christopher Greco

1st Edition

168392648X, 978-1683926481

More Books

Students also viewed these Databases questions

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago