Associative Arrays: Red Black Trees
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.
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.
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.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of