Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Make sure your C - code compiles. Any non - compiling code will receive a very low mark.Thepseudocodeto be given in the code as a
Make sure your Ccode compiles. Any noncompiling code will receive a very low mark.Thepseudocodeto be given in the code as a comment. This isof the marks.Each algorithm is to be associated with aflowchartin pdf This isof the marks.Submit the code file as c and the flowchart as pdf files.Do not make zip or rar files. Upload them as separate files. Those who uploadcompressed file like zip or rarwill get zero mark.Question : Merging DictionariesThis project is a continuation of Project However, you do not need all the codes fromProject Assume that from Project you have the function that deletes and inserts anelement into a dictionary Please refer to Project file for more info Assume that thesefunctions are implemented as DeleteElement, InsertElement and UpdateElement, where ineach case the functions take an array name and the dictionary value.For this project, we want you to merge two dictionaries. Assume that two dictionaries aregiven to you. Here you will implement three algorithms. All three algorithms to be implemented via a function, where the function takes three arrays and their StartingIndex asparameters.Algorithm Points: Take one dictionary, and insert the elements of the other dictionaryonebyone by uisng the InsertElement function If you have implemented this function inProject you can use it here, otherwise, just provide the function call via prototyping
Algorithm Points: Get the StartingIndex for both arrays and make another arraywith the size equal to the total size of both dictionaries to be merged. Then, by comparingthe dictionary values at the startingIndex for both arrays, insert the elements to the thirdarray in a sorted manner until all the elements from both arrays are transferred to the thirdarray.Algorithm Points: Balanced Binary Search Tree Merge Description: This algorithminvolves using a balanced binary search tree BST to merge two dictionaries. Each dictionary is first converted into a balanced BST if not already and then one tree is merged intothe other by inserting all its elements. This ensures that the final tree remains balanced,preserving optimal access times.After you implement the algorithms, provide a complexity analysis for all three algorithmsand determine the efficient algorithm in terms of time and space usage. PointsYou can make any other necessary assumptions.You should print the content of the arrays to indicate that the merging is done successfully
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started