In this article, we have explored the Time and Space Complexity of Heap data structure operations including different cases like Worst, Average and Best case. At the end, we have added a table summarizes the complexities.
List of Operations
InsertionBest Case: O(1)Worst Case: O(logN)Average Case: O(logN)DeletionBest Case: O(1)Worst Case: O(logN)Average Case: O(logN)SearchingBest Case: O(1)Worst Case: O(N)Average Case: O(N)Getting max value & min valueSorting O(Nl...
Published on December 14, 2021 11:40