#memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-30

Teaching data structures in Python gets easier with ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜†_๐—ด๐—ฟ๐—ฎ๐—ฝ๐—ต visualizations. Data structures are no longer abstract concepts but concrete, clear and easy to debug.

Hash_Map demo: memory-graph.com/#codeurl=http

This Hash_Map (Hash_Table) is a Python implementation similar to 'dict'. The demo visualizes:
- adding keyโ€“value pairs
- rehashing
- lookup by key
- iterating over keys

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-24

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-20

Four options for ๐‚๐จ๐ฉ๐ฒ in Python:

๐š’๐š–๐š™๐š˜๐š›๐š ๐šŒ๐š˜๐š™๐šข

๐š๐šŽ๐š ๐šŒ๐šž๐šœ๐š๐š˜๐š–_๐šŒ๐š˜๐š™๐šข(๐šŠ):
... ๐šŒ = ๐šŠ.๐šŒ๐š˜๐š™๐šข()
... ๐šŒ[๐Ÿท] = ๐šŠ[๐Ÿท].๐šŒ๐š˜๐š™๐šข()
... ๐š›๐šŽ๐š๐šž๐š›๐š— ๐šŒ

๐šŠ = [[๐Ÿท, ๐Ÿธ], [๐Ÿน, ๐Ÿบ]]
๐šŒ๐Ÿท = ๐šŠ
๐šŒ๐Ÿธ = ๐šŠ.๐šŒ๐š˜๐š™๐šข()
๐šŒ๐Ÿน = ๐šŒ๐šž๐šœ๐š๐š˜๐š–_๐šŒ๐š˜๐š™๐šข(๐šŠ)
๐šŒ๐Ÿบ = ๐šŒ๐š˜๐š™๐šข.๐š๐šŽ๐šŽ๐š™๐šŒ๐š˜๐š™๐šข(๐šŠ)

c1, ๐š๐ฌ๐ฌ๐ข๐ ๐ง๐ฆ๐ž๐ง๐ญ: nothing is copied, everything is shared
c2, ๐ฌ๐ก๐š๐ฅ๐ฅ๐จ๐ฐ ๐œ๐จ๐ฉ๐ฒ: first value is copied, underlying is shared
c3, ๐œ๐ฎ๐ฌ๐ญ๐จ๐ฆ ๐œ๐จ๐ฉ๐ฒ: you decide what is copied and shared
c4, ๐๐ž๐ž๐ฉ ๐œ๐จ๐ฉ๐ฒ: everything is copied, nothing is shared

see: memory-graph.com/#breakpoints=

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-15

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-09

Visualization of Python execution can help beginners to understand how their program state changes over time and to debug any remaining issues.

For example, a classic intro-course exercise โ€” computing which coins to use to pay an amount using a greedy approach:
memory-graph.com/#codeurl=http

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2026-01-02

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-30

Data structures like Trie: memory-graph.com/#codeurl=http
can in Python be easier understood and debugged after visualization using the memory_graph package: github.com/bterwijn/memory_gra

A Trie is a tree of dictionaries and can be used for things like word completion.

#Python #programming #memory_graph #Tie

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-26

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-19

Algorithms like Cocktail Shaker Sort: lnkd.in/e5e7FUeu
(Bubble Sort in both directions) are easier to understand after visualization using memory_graph: lnkd.in/ePFhkAfH

#Python #programming #memory_graph #sort

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-13

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-09

Binary Trees: memory-graph.com/#codeurl=http
and other data structures become much easier to understand when students can see the structure of their data. Then a data structure is no longer an abstract idea but concrete, clear and debuggable.

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-12-03

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

If you think this could help Python students and educators, please boost.

#Python #programming #memory_graph #DeepCopy #ShallowCopy

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-29

Algorithms can at first seem complex to students, but with memory_graph every step is clearly visualized, giving students an intuitive understanding of what their code is doing and making bugs much easier to spot and fix. Here's an example Bubble Sort algorithm: memory-graph.com/#codeurl=http

#Python #programming #memory_graph #sorting

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-25

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-19

Data structures in Python become much easier to understand when students can see the structure of their data visualized using memory_graph. A data structure is no longer an abstract idea but concrete, clear and debuggable. Hereโ€™s a live demo of a Linear Linked List: memory-graph.com/#codeurl=http

#Python #programming #memory_graph #linkedlist

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-14

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph #copies

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-11

Algorithms can at first seem complex to students, but with memory_graph every step is clearly visualized, giving students an intuitive understanding of what their code is doing and making bugs much easier to spot and fix. Here's an example Insertion Sort algorithm: memory-graph.com/#codeurl=http

#Python #programming #memory_graph #sorting

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-06

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:

- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Bas Terwijn :python:bterwijn@fosstodon.org
2025-11-03

Understanding and debugging Python data structures gets easier with memory_graph visualization. Here's a Multiway Tree example: memory-graph.com/#codeurl=http

A Multiway Tree is similar to a Binary Tree but has an arbitrary number of children making the tree less deep and more efficient.

#Python #programming #memory_graph

A Multiway Tree implementation in Python visualized using memory_graph.
Bas Terwijn :python:bterwijn@fosstodon.org
2025-10-30

An exercise to help build the right mental model for Python data. The โ€œSolutionโ€ link uses memory_graph to visualize execution and reveals whatโ€™s actually happening:
- Solution: memory-graph.com/#codeurl=http
- Explanation: github.com/bterwijn/memory_gra

#Python #programming #memory_graph

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst