See your code think.

Heaps, trees, graphs and tables, drawn from what your program really did. Run Python, C++ or JavaScript and move through it step by step.

Free, no sign-up. Runs in a secure sandbox.

Every one of these is a real run. Click one to open it and change the code.

Features

Everything you need to understand a program.

Ravl records every step your code takes, then lets you look at it the way you need.

def bubble_sort(arr):
n = len(arr)
for i in range(n):
for j in range(n - i - 1):
if arr[j] > arr[j + 1]:
arr[j], arr[j + 1] = arr[j + 1], arr[j]
i = –j = –

step 1 / 40

Timeline

Go back in time

Drag the timeline to any moment. Every variable shows the value it had right then, and the line that ran is highlighted.

Linked list on the ravl canvas

Linked list

Canvas

The right picture, automatically

Arrays, linked lists, trees, heaps, graphs and DP tables are spotted from your code and drawn the way a textbook would.

O(n²)

for i in range(n)

for j in range(n - i - 1)

nsteps

measured with # @input

Complexity

Big-O, with the reason

See your code's time complexity and why. Mark the input with # @input and it reruns at growing sizes to check.

j0

Variables

Every value's history

Open a variable's history to see every value it held, with a small chart, and jump to the step where it changed.

def bubble_sort(arr):
n = len(arr)
for i in range(n):iteration 1
for j in range(n - i - 1):
if arr[j] > arr[j + 1]:
arr[j], arr[j + 1] = arr[j + 1], arr[j]

Hints

See which way it went

Each if line shows whether it was True or False this time, and each loop shows how many rounds it has run.

Sharing

Share a run

Send a link to any run. Anyone can replay it step by step, then fork it into their own playground to change the code.

Supported languages

More languages coming soon

Paste a program. Press Run.

No account needed to start.

Try it now