Explanation : * Outer loop (for i) executed n times.
* Loop (for j) executed logn times so value of
p = logn.
loop (for k) executed log p times.
So value of q = log p = log logn.
for every value of i loop (k) is executed so return
value is n * log logn
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.