data structures

Core data structures available in Groovy programming.

Trees and Graphs in Python: BFS and DFS From Scratch

Trees and graphs in Python are the data structures behind almost everything that has a shape you can draw with dots and lines: a folder tree, a family tree, a social network, a map of roads, the import graph of your own project. This post builds them from scratch with plain classes and dictionaries, then runs breadth-first search (BFS) and depth-first search (DFS) so you can watch the two most important graph algorithms actually move through the data. “Show me ... Read More

Coding Interview Patterns in Python: Two Pointers, Sliding Window, DP

Coding interview patterns are the small set of reusable shapes that most LeetCode-style questions secretly reduce to, and once you can name the shape you stop staring at a blank editor and start writing. This post walks through the six patterns that carry the most weight in real technical screens, two pointers, sliding window, fast and slow pointers, prefix sums, hashmap-first thinking, and dynamic programming, each implemented and run on Python 3.14.6 so you can watch them work instead of ... Read More

Python Time Complexity: Lists, Dicts, Sets Under the Hood

Python time complexity is the reason two programs that produce identical results can finish in five milliseconds or twenty-seven seconds, and the difference usually comes down to which container you reached for. This post takes the four workhorse structures, list, dict, set, and tuple, and shows you exactly what each operation costs by running real timeit measurements, so you stop guessing and start picking the right tool on purpose. “The best programs are written so that computing machines can perform ... Read More