Video: Heap - Heap Sort - Heapify - Priority Queues
create a heap: O(nlogn)
heapify: O(n)
insertion: O(logn)
deletion: O(logn)
Leetcode:
Scenario: User can use discount_code
to get a discount. System records the discount_code_usage
every time the user uses. Please write a query to find total usage and this month usage of discount codes of the user.