Quicksort: Difference between revisions

Content deleted Content added
Dmwpowers (talk | contribs)
m Parallelization: Added middle initials to correctly distinguish author as per citation (and [[]] red-coding) - there are multiple 'David Powers' active in IT. Spelling/grammar/punctuation/typographical correction
Line 61:
''// Temporary pivot index''
i := lo - 1
'''for''' j := lo '''to''' hi - 1 '''do'''
''// If the current element is less than or equal to the pivot''
'''if''' A[j] <= pivot '''then'''
''// Move the temporary pivot index forward''
i := i + 1
''// Swap the current element with the element at the temporary pivot index''
swap A[i] '''with''' A[j]
''// Move the temporary pivot index forward''
i := i + 1
''// MoveSwap the pivot element towith the correctlast pivot position (between the smaller and larger elements)element''
i := i + 1
swap A[i] '''with''' A[hi]
'''return''' i ''// the pivot index''