Rapid sorting method

xiaoxiao2021-04-03  245

*************** Rapid Sort Law Begin ********************************

#include #include #include void qkpass (int a [】, int * p1, int * p2) {// A number of array a [] For the reference INT tag = * p1; // is larger than its placement, smaller than its placed WHILE (P1! = P2) {while ((* p2> tag || * p2 == tag) && p2! = P1) P2 -; IF (* p2 tag && p1! = p2) {* p2 = * p1; p2--;} if (p2 == p1) Break;} * p1 = tag; // At this time p1 == p2, Assigning the TAG as a reference value to the current position} Void Quickorder (int A [】, int * p1, int * p2) {INT * T1 = new int, * t3 = new int, * t2 = new int; // Define three pointers to save status T1 = P1; T2 = P2; if (p1

*************** Rapid Sort Mode Over ********************** The run results are of course: 0 1 2 3 4 5 6 7 8

Haha, I wrote another

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

New Post(0)