0% found this document useful (0 votes)
38 views2 pages

Assignment 5

The objective is to implement a 2-3 tree to handle a DVD database for a video store. Students must implement methods to insert, search, and traverse the tree in preorder, inorder and postorder notation while printing DVD titles. The main method should prompt the user to perform operations and print the tree. Comments and working code are required for full marks.

Uploaded by

wishw244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Assignment 5

The objective is to implement a 2-3 tree to handle a DVD database for a video store. Students must implement methods to insert, search, and traverse the tree in preorder, inorder and postorder notation while printing DVD titles. The main method should prompt the user to perform operations and print the tree. Comments and working code are required for full marks.

Uploaded by

wishw244
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COSC2007O24W: Data Structures II

Assignment-5
Due-date: Friday, March 15, 2024 @11:59pm
Cut-off date: Sunday, March 17, 2024 @11:59pm

Objective:
The objective of this assignment is to build a 2-3 Tree.

Problem Specification:
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, TreeNodes will store the titles of the DVDs. The title will be stored as a string and
titles may consist of multiple words. Please download the TwoThreeTreeAssignmentSample before
start. 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,.
Your task is to implement the following methods:
ˆ void preOrder(TreeNode<T> treeNode) - Traverse and print the tree in preorder notation following the
printing guidelines specified above.
ˆ void inOrder(TreeNode<T> treeNode) - Traverse and print the tree in inorder notation following the
printing guidelines specified above.
ˆ void postOrder(TreeNode<T> treeNode) - Traverse and print the tree in postorder notation following
the printing guidelines specified above.
ˆ TreeNode<T> retrieveItem(TreeNode<T> treeNode, T searchKey) - Search for a specified item in the
tree.
ˆ TreeNode<T> insertItem(TreeNode<T> treeNode, T insertKey) - Insert an item into the 2-3 tree. Be
sure to maintain the 2-3 tree properties.
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 (inorder, preorder, and postorder). Please note
that you will not get any credit if you do not implement generic versions of 2-3 tree operations
with the above-mentioned criteria.

Submission Instructions:
Please note that the submitted work will be considered as your own work and you confirm
that you have not received any unauthorized assistance in preparing for or doing this lab/as-
signment/examination. You confirm knowing that a mark of 0 may be assigned for entire
work.

Submit your complete Java source files (.java). Comment your program carefully so that it can be read
and understood. If your program is not properly commented you may lose marks. See marking scheme
for details.
COSC2007O24W: Assignment-5

Marking Scheme:
You will receive full credits for the working code, otherwise zero. No partial credits!

Comments in the program: 5


Complete program, no compile/logical error, and correct output: 45

©2024 Dr. Zamilur Rahman

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy