C # algorithm ------- (4) rapid sort

zhaozj2021-02-08  218

I have introduced three sorted algorithms, which is relatively simple. Today I wrote a rapid sort algorithm. I hope more advice. I don't have an answer. Excellent experience.

Using system;

Namespace QuicksORTER {PUBLIC CLACKSORTER {Private Class QuicksRer {Private Void SWAP (Ref Int L, Ref Int R) {INT S; S = L; L = R; R = S;} public void sort (int]), int low, int ) {INT PIVOT; INT L, R; INT MID; if (high <= LOW) RETURN; ELSE IF (high == LOW 1) {if (List [low]> list [high]) SWAP (Ref List] LOW], ref list [high]); RETURN;} MID = (low high) >> 1; pivot = list [mid]; swap (ref list [low], ref list [MID]); l = low 1; r = high; do {while (l <= r && list [l] = pivot) r -; if (l

} It has been compiled, the operation environment: Windows XP VC # .NET 7.0

Author: Gu Jianhui

转载请注明原文地址:https://www.9cbs.com/read-2542.html

New Post(0)