Reorder a list from least to greatest

I’m collecting a list of numbers from student input with the “aggregate” function. Can anybody think of a way for me to take that list and create a list with the same members but in least-to-greatest order?
Can this be a dynamic process that orders my new list every time an input is added to the aggregate list?

Some student inputs may be the same as each other, so I need to be able to take L = [5, 5, 3, 1, 2, 1] and reorder it to M = [1, 1, 2, 3, 5, 5].

I found a way just using the function list on the graphing calculator:
M = quantile ( L, ( [ 0…(length(L)-1)] / (length (L) - 1))
Essentially, it says, “M is a list of (the 1st item in L, the second item in L… the last item in L).”
Yay fun.

1 Like

Ya I was gonna say I think quantile is the key.
Heres what I did…


Thank you! That’s an elegant demonstration, mrxepstein. :slightly_smiling_face: