thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

C++ vs Python

β€’ 67 words β€’ 1 min

When LeetCoding or participating in programming contests, it’s worth to highlight a few differences between C++ and Python:

cpp
- maximum priority queue (PQ)
- `sort` with a comparison function
- ordered set / map β€” `O(log n)` β€” BST (binary search tree)
python
- minimum priority queue (PQ)
- `sort` with a key function
- insertion order set / map β€” `O(1)` β€” HT (hash tree)