You are given the task of reading in n numbers and then printing them out in sorted order. Suppose you have access to a balanced dictionary data structure, which supports each of the operations search, insert, delete, minimum, maximum, successor, and predecessor in O(log n) time.
• Explain how you can use this dictionary to sort inO(n log n) time using only the following abstract opera- tions: minimum, successor, insert, search.
• Explain how you can use this dictionary to sort inO(n log n) time using only the following abstract opera- tions: minimum, insert, delete, search.
• Explain how you can use this dictionary to sort inO(n log n) time using only the following abstract opera- tions: insert and in-order traversal.

Respuesta :

Answer:

Follows are the solution to this question:

Explanation:

These functions to interpret but instead, print their for store assuming that have such a healthy connection,  which data structure dictionary promoting each searching operation, add, remove, minimum, maximum, successor, and O(log n) time was its pre successor.  

  • Use its dictionary only for following abstract procedures, minimal, succeeding, in O(n login) time,  search, add. It uses a dictionary with only the corresponding conceptual functions, minimize, add, in O(n log n) time, remove, search.  
  • Use the dictionary only for corresponding abstract procedures to sort, add, and sort in O(n log n) time. and in-order traversal.  It is the most and minimum shop value, that want to be checked and updated from each deletion.  
  • When a minimum is removed, call the holder, change the minimum, and remove the single object.  Once inserted, evaluate the brand new item to min/max, then update min/max if it replaces either one.