Sort List Numerically

I would like to sort a list of numbers to:

(1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20)

I tried ListUtils but it only sort by alphabet.
image

This is a sample. I have a huge list of numbers. Suggest me the best way to approach or maybe @Hossein add an option to the sort order.

don’t know about the extension but I think this code can help you to manually set up a method to sort meanwhile

a  = [1,4,53,5,2,3,56,3,5,67,5,35]

for i in range(1,len(a)):
    key = a[i]
    j = i-1
    while j>=0 and a[j] > key:
        a[j+1] = a[j]
        j -=1
    a[j+1] = key

print(a)

here ‘a’ is the list

Use this… & use block bubble sort list…
@Hassan_Alzaki

5 Likes

Thank you @Deepanshu_Arya @Alapjeet for helping.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.