Is there a way to sort an empty list of strings as you add more values to the list? I cannot find a decent example of this anywhere and struggling with this.
The insertion sort seemed like the logical plan, but I cannot for the life of me find anything regarding this. Not even my textbook.
an example I found
def insertion_sort ( lista ):
for i in range ( 1, len ( lista ) ):
save = lista[i]
j = i
while ( j > 0 and lista [j - 1] > save ):
lista[j] = lista[j - 1];
j -= 1
lista[j] = save
^^ is the only idea i have, yet I do not know what is happening in the code