946 {
947 string pivot = arr.Get( left );
948 int i = left;
949 int j = right + 1;
950 string temp;
951
952 while ( true )
953 {
954 while ( true )
955 {
956 i++;
957 if ( i > right || arr.Get(i) > pivot )
958 {
959 break;
960 }
961 }
962
963 while ( true )
964 {
965 j--;
966 if ( arr.Get(j) <= pivot )
967 {
968 break;
969 }
970 }
971
972 if ( i >= j )
973 {
974 break;
975 }
976
978 arr.
Set( i, arr.Get(j) );
979 arr.Set( j, temp );
980 }
981
982 temp = arr.
Get( left );
983 arr.
Set( left, arr.Get(j) );
984 arr.Set( j, temp );
985
986 return j;
987 }
proto string Get(int index)
Gets n-th character from string.
proto void Set(int index, string input)
Sets the n-th character in string with the input, replacing previous value.