data structures

Core data structures available in Groovy programming.

Sorting and Searching Algorithms in Python (From Scratch)

Ask a room of developers who last shipped a hand-written sort and you get silence; ask who was grilled on one in an interview and every hand goes up. Sorting algorithms are the push-ups of programming: rarely performed on the job, but they build the muscle the job needs. Here you write linear and binary search plus four classic sorts, then time them against Python’s own sorted(). “Let me see your code and I won’t usually need your flowcharts; show ... Read More

Stacks and Queues in Python, Explained With deque

Stacks and queues are the two simplest ways to line up data, and once you can see them you start noticing them everywhere: the browser back button, the undo key, the print jobs waiting on a shared printer. This post builds both from Python’s standard library, wires up a linked list by hand so you understand what a “pointer” really is, and then puts them to work on the exact problems interviewers love to ask. “Bad programmers worry about the ... Read More

Big O Notation in Python, Explained with Real Timings

Big O notation is the language engineers use to describe how an algorithm’s cost grows as the input gets bigger, and once you can read it you stop guessing about performance and start predicting it. This post skips the heavy math and instead runs real timeit measurements so you can watch O(1), O(log n), O(n), O(n log n), and O(n squared) behave exactly the way the theory says they will. “Premature optimization is the root of all evil.” Donald Knuth, ... Read More