D
Dongsheng Ruan
I want to turn an Array into a heap, but my code just doesn't work: no
change after execution.
A=[3,5,4,9,6,7]
m=len(A)-1
for i in range(m,1):
t=(i-1)/2
if A>A[t]:
A,A[t]=A[t],A
change after execution.
A=[3,5,4,9,6,7]
m=len(A)-1
for i in range(m,1):
t=(i-1)/2
if A>A[t]:
A,A[t]=A[t],A