Programming Exercise #10 (Associative Arrays: Red Black Trees) Overview In the last PEX8, you restructured the implementation of your parts database using a binary search tree. However, the...

It should run on Centos Linux.Makefile should be included.Psuedocode and comments should be added please.No more than 24 hours (URGENT).Instructions are in word document. Please refer to rubric.Expected tests and tests will be included in the chat.


Programming Exercise #10 (Associative Arrays: Red Black Trees) Overview In the last PEX8, you restructured the implementation of your parts database using a binary search tree. However, the performance hasn’t gotten any better. After much wailing and gnashing of teeth, you have observed the data entry folks adding parts to the database. Whenever parts are added, they are added in alphabetical order. DOH! Your BST isn’t any better than your list implementation. You have decided to change your BST implementation into a red black tree. This ensures that during the database creation process your tree remains roughly balanced. Hopefully this will result in a much better search time when the database is queried in the future. Parts Catalog Architecture The parts catalog is an associative array of associative arrays. The outermost array is keyed by part name, (a string in this case). The content of the outer associative array is the inner associative array. The inner associative array is keyed by a parameter name and the content is the parameter value, (both strings). When iterating through the structure it should be possible to print all part names in order and then print each parameter and associated value for that part in order of parameter name. It should also be possible to extract any given parameter value by using the get methods. For this exercise, you are only required to implement the tree balancing for insert operations, (i.e. your tree does not need to support delete operations at all). However, if you choose to build delete operations for your red black tree, you will be awarded extra credit. Programming Concepts This exercise covers many programming concepts including red black trees, inheritance, deep copy, constructor types including default and delete, operator overloading, pass by ref and by val, return by ref, stack vs heap, binary search trees, templates, reference counting pointers, lambdas, closures, functors, and abstract base classes. System Requirements The design must use the provided interface header verbatim. This will allow automated testing of the design you produce. See grading rubric for specific system requirements and associated grade values. Grading Rubric (PEX10) Requirement / Criteria Available Points Student’s Score Uses base class interface verbatim 10 Needed BST base functionality is correct 10 Red black insert correctly recolors when appropriate 10 Red black insert correctly rotates when appropriate 20 Red black insert correctly handles changes in root node 10 Red black delete functionality implemented (Extra Credit) 30 Total 60
Dec 08, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here