- write python class that can take any red-black tree and convert it into its corresponding ( tree and can take any ( tree and convert it into its corresponding red-black tree - in describing multisets and multimaps in section we describe general approach for adapting traditional map by storing all duplicates within secondary container as value in the map give an alternative implementation of multimap using binary search tree such that each entry of the map is stored at distinct node of the tree with the existence of duplicateswe redefine the search tree property so that all items in the left subtree of position with key have keys that are less than or equal to kwhile all items in the right subtree of have keys that are greater than or equal to use the public interface given in code fragment - prepare an implementation of splay trees that uses top-down splaying as described in exercise - perform extensive experimental studies to compare its performance to the standard bottom-up splaying implemented in this - the mergeable heap adt is an extension of the priority queue adt consisting of operations add(kv)min)remove minand merge( )where the merge(hoperations performs union of the mergeable heap with the present oneincorporating all items into the current one while emptying describe concrete implementation of the mergeable heap adt that achieves (log nperformance for all its operationswhere denotes the size of the resulting heap for the merge operation - write program that performs simple -body simulationcalled "jumping leprechauns this simulation involves leprechaunsnumbered to it maintains gold value gi for each leprechaun iwhich begins with each leprechaun starting out with million dollars worth of goldthat isgi for each in additionthe simulation also maintainsfor each leprechaunia place on the horizonwhich is represented as double-precision floating-point numberxi in each iteration of the simulationthe simulation processes the leprechauns in order processing leprechaun during this iteration begins by computing new place on the horizon for iwhich is determined by the assignment xi xi rgi where is random floating-point number between - and the leprechaun then steals half the gold from the nearest leprechauns on either side of him and adds this gold to his gold valuegi write program that can perform series of iterations in this simulation for given numbernof leprechauns you must maintain the set of horizon positions using sorted map data structure described in this