Several simple and common algorithms

xiaoxiao2021-03-06  92

#include

#include

INT FIND (int Array [], int size, int Date / * General lookup method * / {??? INT i; ??? if (size <= 0) ???? Return -1; ??? for (i = 0; i = END) ???? Return; ??? for (i = begin 1; i <= end; i) ?? ?? IF (array [begin]> array [i]) ?? ?????? swap (& array [begin], & array [i]); ??? m_sort (Array, Begin, End); ???} void Q_Sort (int Array [], int based, int end ) / * Quick Sort Law * / {??? INT I, Last; ??? ??? IF (begin> = End) ???? Return; ??? Swap (& Array [Begin], & Array END) / 2]); ??? Last = begin; ??? for (i = begin 1; i <= end; i) ?? ?? IF (array [i] array [MID) ]) ???????? begin = MID 1; ??????? Else if (Date

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

New Post(0)