LANGUAGE REFERENCE
Python and Java guides
Follow Python control flow, choose a container or check what Java callers can change. Each guide explains the relevant language rules with a worked example.
Python
- Python try, except, else and finally: follow one failed conversion Learn Python try/except with runnable examples. Trace else and finally, catch the right exception, and avoid hiding unrelated failures.
- Python RecursionError: fix the cause before raising the limit Fix maximum recursion depth exceeded in Python. Distinguish a missing stop condition, a self-calling property, a cycle, and a genuinely deep input.
- deque in Python Know when a Python deque beats a list, why the middle stays O(n) while both ends stay O(1), and how maxlen silently discards the data you meant to keep.
- Linked list in Python: build one, then choose the right container Implement a minimal singly linked list in Python, check its operation costs, and learn when list or collections.deque is the better tool.
- Priority queues and binary heaps in Python Use Python heapq to build a binary heap, retrieve priorities, keep equal-priority tasks in arrival order, and understand operation costs.
- Topological sort: Kahn's algorithm in Python Trace a dependency order, run Kahn's algorithm in Python, detect a cycle, and compare DFS with graphlib's TopologicalSorter.
Java
- Abstract class vs interface in Java: what each one shares Use one Java export example to compare interfaces and abstract classes: what callers can request, what objects inherit, and when neither needs a base class.
- Encapsulation in Java: keep object state valid See how a private list can still break a class's rules. Try direct access, a read-only view and a snapshot, then run a complete Java example.
- HashMap vs Hashtable Find out what actually separates the two beyond a capital letter, and why the older one is still in the language long after it stopped being advice.