Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sorting array without inbuilt sort

data_list = [-5, -23, 5, 0, 23, -6, 23, 67]
new_list = []

while data_list:
    minimum = data_list[0]  # arbitrary number in list 
    for x in data_list: 
        if x < minimum:
            minimum = x
    new_list.append(minimum)
    data_list.remove(minimum)    

print new_list
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #sorting #array #inbuilt #sort
ADD COMMENT
Topic
Name
2+7 =