We will use binary search tree kind of data structure (Heap Sort) to implement the operation of sorting..
Time complexity of Heap Sort for n items is O(n log n).
The time complexity for log (n) distinct elements will be O(n loglog n) ...
I am new to this platform so please correct me if am wrong..