Data structure - Tree

Segment Tree

Data structure - Heap

Video: Heap - Heap Sort - Heapify - Priority Queues create a heap: O(nlogn) heapify: O(n) insertion: O(logn) deletion: O(logn)

Data structure - Skiplist

Leetcode:

Data structure - Deque

Leetcode:

Data structure - Stack

Leetcode:

Reservoir sampling

Leetcode:

LRU cache

Leetcode:

Data structure - Trie

Leetcode:

Algorithm - Backtracking

Leetcode:

Count discount code usage

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.