Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = [9,8,7,6,5,5,4,3,2,1]
- def QuicSort(A,pocz,kon):
- if pocz==kon:
- return 0
- piv= A[pocz]
- L=pocz
- P=kon
- while L<=P:
- while A[L]<piv:
- L=L+1
- while A[P]>piv:
- P=P-1
- if L<=P:
- A[L],A[P]=A[P],A[L]
- L=L+1
- P=P-1
- if P>pocz:
- QuicSort(A,pocz,P)
- if L<kon:
- QuicSort(A,L,kon)
- print(QuicSort(t,0,len(t)-1))
- print(t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement