Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
(Fixed mistake in the Ada implementaion) |
|||
Line 175: | Line 175: | ||
exit when Left >= Right; |
exit when Left >= Right; |
||
Swap(Item(Left), Item(Right)); |
Swap(Item(Left), Item(Right)); |
||
if |
if Pivot_Index = Left then |
||
Pivot_Index := Right; |
|||
Right |
elsif Pivot_Index = Right then |
||
Pivot_Index := Left; |
|||
end if; |
end if; |
||
end loop; |
end loop; |