def insertionSort(array): for step in range(1, len(array)): key = array[step] j = step - 1
# Compare key with each element on the left of it until an element smaller than it is found # For descending order, change keyarray[j]. while j >= 0 and key < array[j]: array[j + 1] = array[j] j = j - 1
# Place key at after the element just smaller than it. array[j + 1] = key
Amazingly clear and concise video! Thank you, this helped a lot in my DSA class.
life changing video thank you i like the sound too
This animation is really good! did you created this using Manim?
Wow, the animation is great! Did you use the 3b1b library to make this?
def insertionSort(array):
for step in range(1, len(array)):
key = array[step]
j = step - 1
# Compare key with each element on the left of it until an element smaller than it is found
# For descending order, change keyarray[j].
while j >= 0 and key < array[j]:
array[j + 1] = array[j]
j = j - 1
# Place key at after the element just smaller than it.
array[j + 1] = key
Que animación tan buena!
Very helpful!
for an array A, of size N and containing N elements:
for int i from 1 to N-1
int j = i
while j > 0 && a[j] < a[j-1]
swap(a[j], a[j-1])
j--
So satisfying 👍
thank you
thank you so much
is this ASMR