COP3503 Computer Science 2 Dr. Andrew Steinberg Summer 2022 Programming Assignment 2 Address Book Assignment Due: 7/1/2022 at 11:59pm Objective: Students will apply concepts of Java Generics and...

1 answer below »

Programming Assignment 2 Programming Assignment 2 Address Book Assignment
Address Book Assignment Address Book Assignment


COP3503 Computer Science 2 Dr. Andrew Steinberg Summer 2022 Programming Assignment 2 Address Book Assignment Due: 7/1/2022 at 11:59pm Objective: Students will apply concepts of Java Generics and Red-Black Trees in this programming assignment. Assignment Description: In this class, we have learned a couple of advanced data structures related to trees. In this assignment, you will manage an address book of professors with the abstract data type (ADT) red-black tree data structure. You will create your own Red-Black Trees using Java Generics This programming assignment must be completed in the Java programming language. Any other language used will result in score of 0 on the assignment. For this assignment, you must follow these requirements. 1. You will create an ADT Red-Black Tree class called AddressBookTree with Java Generics (type T and type U). The attribute for the class must contain: a. root of Node b. You may create additional helper attributes that can assist with maintaining the red-black tree. 2. You will use two unique type variables T and U. T represents the name and U represents office. 3. You will create a Node class that will represent the nodes in a red-black tree using generics. The attributes needed for the class are a. Name of type T (Generics) b. Office of type U (Generics) c. Reference to parent node d. Reference to left child node e. Reference to right child node f. An int that represents color (0 for black and 1 for red) 4. The AddressBookTree class must have the following methods. Most of the methods have been provided to you in the pseudocode on the slides. a. Default constructor i. Set everything to default values. b. Insert i. Parameter takes two arguments: T name, U office c. Insert-Fix (applying rules for insertion) i. Parameter takes one argument: Node d. Delete i. Parameter takes one argument: T name e. Delete-Fix (applying rules for deletion) i. Parameter takes one argument: Node COP3503 Computer Science 2 Dr. Andrew Steinberg Summer 2022 f. Rotations (both left and right) i. Parameter for both takes one argument: Node g. RB-Transplant i. Parameter takes two arguments: Node and Node h. Display (inorder traversal) i. No arguments needed. Note: There is a space between the name and office. i. countBlack – method to count black nodes in tree i. Parameter takes Node to count from (the root) j. countRed – method to count red nodes in tree i. Parameter takes Node to count from (the root) k. You may also create additional helper methods as well. 5. Make all methods public and class attribute private. It’s good practice! A runner file (AddressBookTreeRunner.java) has been provided for you to show you how the methods are called along with 3 test cases based on maintaining the tree after certain operations. A text file is also provided for you that will help fill the tree in the initial run. The text file itself must be in the same directory as the runner file. What to submit: Submit a file called AddressBookTree.java to webcourses. You are not required to submit the runner file as that will be provided for the graders to test your code. Please make sure the runner file provided works for your code. Any name changes may cause your program not to work when graded, which will result in a lower score on the assignment and would not be changed. Important Note for running Eustis: Many of you are probably using IDEs like Netbeans and Eclipse to build your Java Solutions. Please note that some of these IDEs will automatically place your Java file in some sort of package. Please make sure your Java file is not defined in some package as this can result package private errors. Any such error that occurs during the grading will not be fixed and points will be deducted as such in accordance with the respective categories in the rubric. Also, DO NOT create a main method in your solution file!! This will result in your code not running properly with the runner file which will result in points being deducted from the respective categories. Tanvir AhmedENG1-453 Sarah AngellHEC-230 Reza AriaHEC-258 Matthew GerberHEC-257 Andrew SteinbergHEC-341 Sean SzumlanskiHEC-219 Arup GuhaHEC-240 Tom HollandHEC-003D Richard LeineckerHEC-357 Mark LLewellynHEC-236 Travis MeadeHEC-328 Euripides MontagneHEC-216 Thomas NedorostHEC-317 Karin MarkleHEC-412 Yanjie FuHPA2-238 Paul GazzilloHEC-239 Johnathan MellHPA2-238G Yogesh Singh RawatHEC-241 Sharma ThankachanHEC-207 Scarlett JohanssonHEC-004 Delores UmbridgeHEC-108D Wei ZhangBIO-137B Damian DechevHEC-221 Ryan ReynoldsHEC-002C Mark HeinrichHEC-345 Haiyan HuHEC-233 Fei LiuHEC-217 Niels da Vitoria LoboHEC-252 Jennifer LawrenceHEC-001B Abhijit MahalanobisHEC-244 Ryan McMahanHEC-433 David MohaisenHPA2-240 Sumanta PattanaikHEC-437E Dirk ReinersHEC-220 Liqiang WangHEC-437E Melisa MccarthyHEC-112 Pamela WisniewskiHEC-217A Annie WuHEC-314 Cliff ZouHEC-243 Ladislau BoloniHEC-319 Carolina Cruz-NeiraHEC-214 Hassan ForooshHEC-212 Chris PrattHEC-123G Kien HuaHEC-229 Charles HughesHEC-247C Joseph LaViola IIHEC-321 Gary T. LeavensHEC-329 Dan MarinescuHEC-304 Mubarak ShahHEC-245D Johnny DeppHEC-001A Yan SolihinHPA2-239 Gita SukthankarHEC-232 Damla TurgutHEC-316 Shibu YoosephBIO-133A Shaojie ZhangHEC-311 Amy PoehlerHEC-300 ************************************************* Beginning Test Cases... Test Case 1... Testing the initial setup... Abhijit Mahalanobis HEC-244 Amy Poehler HEC-300 Andrew Steinberg HEC-341 Annie Wu HEC-314 Arup Guha HEC-240 Carolina Cruz-Neira HEC-214 Charles Hughes HEC-247C Chris Pratt HEC-123G Cliff Zou HEC-243 Damian Dechev HEC-221 Damla Turgut HEC-316 Dan Marinescu HEC-304 David Mohaisen HPA2-240 Delores Umbridge HEC-108D Dirk Reiners HEC-220 Euripides Montagne HEC-216 Fei Liu HEC-217 Gary T. Leavens HEC-329 Gita Sukthankar HEC-232 Haiyan Hu HEC-233 Hassan Foroosh HEC-212 Jennifer Lawrence HEC-001B Johnathan Mell HPA2-238G Johnny Depp HEC-001A Joseph LaViola II HEC-321 Karin Markle HEC-412 Kien Hua HEC-229 Ladislau Boloni HEC-319 Liqiang Wang HEC-437E Mark Heinrich HEC-345 Mark LLewellyn HEC-236 Matthew Gerber HEC-257 Melisa Mccarthy HEC-112 Mubarak Shah HEC-245D Niels da Vitoria Lobo HEC-252 Pamela Wisniewski HEC-217A Paul Gazzillo HEC-239 Reza Aria HEC-258 Richard Leinecker HEC-357 Ryan McMahan HEC-433 Ryan Reynolds HEC-002C Sarah Angell HEC-230 Scarlett Johansson HEC-004 Sean Szumlanski HEC-219 Shaojie Zhang HEC-311 Sharma Thankachan HEC-207 Shibu Yooseph BIO-133A Sumanta Pattanaik HEC-437E Tanvir Ahmed ENG1-453 Thomas Nedorost HEC-317 Tom Holland HEC-003D Travis Meade HEC-328 Wei Zhang BIO-137B Yan Solihin HPA2-239 Yanjie Fu HPA2-238 Yogesh Singh Rawat HEC-241 TEST 1 Passed! ************************************************* Test Case 2... Testing the insert method... Inserting some items... TEST 2 Passed! ************************************************* ************************************************* Test Case 3... Testing the deletion method... Removing some items... TEST 3 Passed! Ending Test Cases... ************************************************* Abhijit Mahalanobis HEC-244 Andrew Steinberg HEC-341 Annie Wu HEC-314 Arup Guha HEC-240 Carolina Cruz-Neira HEC-214 Charles Hughes HEC-247C Cliff Zou HEC-243 Damian Dechev HEC-221 Damla Turgut HEC-316 Dan Marinescu HEC-304 David Mohaisen HPA2-240 Dirk Reiners HEC-220 Euripides Montagne HEC-216 Fei Liu HEC-217 Gary T. Leavens HEC-329 Gita Sukthankar HEC-232 Haiyan Hu HEC-233 Hassan Foroosh HEC-212 Johnathan Mell HPA2-238G Joseph LaViola II HEC-321 Karin Markle HEC-412 Kien Hua HEC-229 Ladislau Boloni HEC-319 Liqiang Wang HEC-437E Mark Heinrich HEC-345 Mark LLewellyn HEC-236 Matthew Gerber HEC-257 Mubarak Shah HEC-245D Niels da Vitoria Lobo HEC-252 Pamela Wisniewski HEC-217A Paul Gazzillo HEC-239 Reza Aria HEC-258 Richard Leinecker HEC-357 Ryan McMahan HEC-433 Sarah Angell HEC-230 Sean Szumlanski HEC-219 Shaojie Zhang HEC-311 Sharma Thankachan HEC-207 Shibu Yooseph BIO-133A Sumanta Pattanaik HEC-437E Tanvir Ahmed ENG1-453 Thomas Nedorost HEC-317 Travis Meade HEC-328 Wei Zhang BIO-137B Yan Solihin HPA2-239 Yanjie Fu HPA2-238 Yogesh Singh Rawat HEC-241 ************************************************* Yay! All test cases passed!
Answered 1 days AfterJun 22, 2022

Answer To: COP3503 Computer Science 2 Dr. Andrew Steinberg Summer 2022 Programming Assignment 2 Address Book...

Aditi answered on Jun 22 2022
84 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here