PA of Algorithms Q69

0. An algorithm performs (logN)1/2 find operations, N insert operations, (logN)1/2 delete operations, and (logN)1/2 decrease-key operations on a set of data items with keys drawn from a linearly ordered set. For a delete operation, a pointer is provided to the record that must be deleted. For the decrease-key operation, a pointer is provided to the record that has its key decreased. Which one of the following data structures is the most suited for the algorithm to use, if the goal is to achieve the best total asymptotic complexity considering all the operations?

  • Option : A
  • Explanation :
    Unsorted array
    The algorithm perform
    find operation (log N)½
    Insert operation N
    delete operation (log N)½
    decrease key operations (log N)½
    Hence unsorted array is best data structure for all above operations.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *