I wrote a selection sort implementation that doesn't work. I can't figure out why.
#!/usr/bin
def sel_sort(list):
for i in xrange(n-2):
imin=i
for j in xrange(i+1,n-1):
if list[j]<list[imin]:
imin=j
list[imin],list[i]=list[i],list[imin]
n=int(raw_input("Enter number of elements : "))
x=[]
for t in xrange(n):
x.append(int(raw_input()))
sel_sort(x)
for k in xrange(n):
print x[k],
Also could anyone explain why I should place #!/usr/bin
at the beginning of this program?