Difference between 'instance', 'class', and 'static' method visually explained
The difference in Python OOP between:
- instance method
- class method
- static method
visually explained using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Or see more memory_graph examples.
The difference in Python OOP between:
visually explained using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Or see more memory_graph examples.
An exercise to help build the right mental model for Python data.
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Recursion can be hard to understand when you only look at the code.
Take quick_sort. Most explanations say:
That is correct, but it does not show what is really happening during execution. With package 𝗶𝗻𝘃𝗼𝗰𝗮𝘁𝗶𝗼𝗻_𝘁𝗿𝗲𝗲 you can step through the program and see the actual tree of function calls grow:
quick_sort(...)
This makes recursive algorithms much easier to reason about, especially for students who often struggle to build the right mental model for recursion.
See the live quick_sort demo.
The goal is simple: make recursion visible for easy understanding.
Ever wondered what a Trie actually looks like in memory?
A Trie is a tree of dictionaries, often used for problems like:
But when you implement one in Python, it can quickly become hard to “see” what is going on. That is where 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 helps.
It visualizes the actual Python objects: dictionaries, references, nested structure, and how the Trie grows step by step. Instead of only reading code, you can see the data structure being built in memory.
Run the Live Demo.
Visualizing data structures this way can make them much easier to understand and debug, especially for students learning Python.
See more 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 examples.
An exercise to help build the right mental model for Python data.
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Understanding and debugging data structures becomes much easier when you can simply see the structure of your data with 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Run this Linked List live demo.
A linked list is a nice teaching example because it makes references very explicit:
Normally, students have to imagine all of this in their head. With 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵, they can inspect the actual Python objects and references directly. That makes it easier to understand:
For beginners, this helps build the right mental model of Python data. For more advanced students, it helps debug pointer-like reference bugs in data structures.
An exercise to help build the right mental model for Python data.
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Algorithms like Radix Sort are much easier to understand when you can see every intermediate step.
Using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵, you can watch how Radix Sort repeatedly applies stable Counting Sort, sorting the least significant digit up to the most significant digit in turn.
The key idea is stability: after sorting by a later digit, the order created by earlier digit-sorts is preserved resulting in a full sorted sequence.
For fixed-size integers, Radix Sort can be very efficient, with time complexity O(n · d), where 'n' is the number of values and 'd' is the number of digits.
Algorithms like Radix Sort are much easier to understand when you can see every intermediate step.
Using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵, you can watch how Radix Sort repeatedly applies stable Counting Sort, sorting the least significant digit up to the most significant digit in turn.
The key idea is stability: after sorting by a later digit, the order created by earlier digit-sorts is preserved resulting in a fully sorted sequence.
For fixed-size integers, Radix Sort can be very efficient, with time complexity O(n · d), where 'n' is the number of values and 'd' is the number of digits.
An exercise to help build the right mental model for Python data.
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
Algorithms in Python can be much easier understood with step-by-step visualization using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵. Here we show a simple DNA k-mer counting algorithm.
Algorithms in Python can be much easier understood with step-by-step visualization using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵. Here we show a simple DNA k-mer counting algorithm.
Algorithms in Python can be easier understood with step-by-step visualization using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵. Here we show a Breadth First algorithm that finds the shortest path in a graph from node 'a' to node 'b'.