Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def bubble_sort(arr):
|
|
| 10 |
for j in range(0, n - i - 1):
|
| 11 |
if arr[j] > arr[j + 1]:
|
| 12 |
arr[j], arr[j + 1] = arr[j + 1], arr[j]
|
| 13 |
-
|
| 14 |
return steps
|
| 15 |
|
| 16 |
# Insertion Sort Algorithm with animation
|
|
|
|
| 10 |
for j in range(0, n - i - 1):
|
| 11 |
if arr[j] > arr[j + 1]:
|
| 12 |
arr[j], arr[j + 1] = arr[j + 1], arr[j]
|
| 13 |
+
steps.append(list(arr)) # Record the state of the array after each step
|
| 14 |
return steps
|
| 15 |
|
| 16 |
# Insertion Sort Algorithm with animation
|