DStruct Logo

Your code, frame by frame. Step forward. Step back.

A LeetCode-style playground where your solution becomes a visual execution trace for trees, graphs, grids, linked structures, and nested maps. JavaScript and Python in the browser, replayable state changes, and optional timing stats for JS.

Try it out nowBrowse Projects
Frequently asked questions

JavaScript runs in a Web Worker; Python uses Pyodide in its own worker so the page stays responsive.

JavaScript
Python
Time-travel playback
Run and record
Replay
Callstack
javascript
solution.js
function invertTree(root) {
  if (!root) return null;

  const left = invertTree(root.left);
  const right = invertTree(root.right);

  root.left = right;
  root.right = left;
  return root;
}
Time-travel playback
Frame 42 / 60
4
2
7
1
3
6
9
Callstack

02 Call invertTree(7)03 Call invertTree(2)42 Reverse node.left ↔ node.right43 Return root (4)
Replay how your data structures change. Understand and debug with a real execution trace.

See the algorithm, not just output

See the algorithm, not just output

Replay how your data structures change. Understand and debug with a real execution trace.

Smooth UI while code runs

JavaScript runs in a Web Worker; Python uses Pyodide in its own worker so the page stays responsive.

Time-travel playback

Play, pause, step, replay, and tune playback speed—including keyboard shortcuts.

Benchmark JavaScript

Measure many runs with median, percentiles, and a chart. Benchmark mode is JS-only today.

How it works

Use the built-in editor with familiar patterns for each project category.

01
Run

Tracked APIs turn structural work into a callstack of frames—no canned animation.

02
Forward

Step forward and backward, change speed, and inspect each operation in the log.

03
Replay

Play, pause, step, replay, and tune playback speed—including keyboard shortcuts.

04
Callstack

Replay how your data structures change. Understand and debug with a real execution trace.

Algorithm gallery

Browse Projects

Open a curated playground to see the debugger on a real problem, or jump into the full browser.

Algorithm gallery
Binary tree

invert binary tree

Browse Projects

Common questions

Visual playback comes from dStruct's tracked data-structure APIs. Pick a matching project category and use the wrappers the playground expects. Plain objects without those APIs may print output but won't produce a step-by-step replay.

Trees, BST, linked lists, graphs, grids and matrices, arrays, heaps, stacks, trie, DP, two pointers, sliding window, backtracking, and more. Browse the playground or check categories when creating a project.

No for normal use. JavaScript runs in a Web Worker; Python runs with Pyodide in the browser. A local Python server is optional for developers only.

By default, no—execution happens in your browser. Saving projects, sign-in, and browsing cloud projects use the backend like any web app.

Yes. Projects can store separate JS and Python solutions. Benchmark mode is JavaScript-only today.

Pyodide preloads in the background when you open a Python page. The first visit downloads the runtime (~30 MB, then cached); WASM startup can take a few seconds even from cache. After that, Run is usually quick.

Not in the default playground—standard library only. Third-party imports will fail.

Python times out after 30 seconds by default; the worker is then recreated. Cancellation is coarse for very heavy work.

Use public projects and the editor without signing in. To persist projects, test cases, and named solutions, sign in.

Yes. Make a project public and use Browse to discover examples.

Optional profile features, pasting a LeetCode problem URL to fill metadata, and shortcuts to open the same problem on LeetCode. Submitting solutions still happens on LeetCode—dStruct is a companion playground.

Yes, for JavaScript—use Benchmark mode (many iterations, median, percentiles, chart). Python does not have benchmark mode yet.

There is a mobile-friendly playground flow with keep-alive when switching tabs. Long editing sessions are still easiest on desktop.

Yes. See the LICENSE file in the repository (AGPL-3.0).
© Max Kayander, 2026.