• API
• FAQ
• Tools
• Archive
daily pastebin goal
7%
SHARE
TWEET

# Untitled

a guest Aug 12th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. template <class OBJ>
2. void AlgorytmySortowania<OBJ>::QuickSortRekur(int L, int R)
3. {
4. int i;
5.   if(++this->ZA.GlSto > this->ZA.GlStoMax)  this->ZA.GlStoMax=this->ZA.GlSto;
6.
7.                                                            this->ZA.LiPor++;
8.     if(R>L){
9.     i=Rozdziel(L,R);
10.     QuickSortRekur(L,i-1);
11.     QuickSortRekur(i+1,R);
12.   }
13.   this->ZA.GlSto--;
14. };
15.
16. template <class OBJ>
17. void AlgorytmySortowania<OBJ>::QuickSortRekurFactorM(int L, int R,int M){
18. int i;
19.   if(++this->ZA.GlSto>this->ZA.GlStoMax)this->ZA.GlStoMax=this->ZA.GlSto;
20.                                                            this->ZA.LiPor++;
21.     if(R-L>M){
22.     i=Rozdziel(L,R);
23.     QuickSortRekurFactorM(L,i-1,M);
24.     QuickSortRekurFactorM(i+1,R,M);
25.   }else
26.     PrzezWstawianie2QS(L,R);
27.   this->ZA.GlSto--;
28. };
29.
30. template <class OBJ>
31. void AlgorytmySortowania<OBJ>::QuickSortRekurMediana(int L, int R,int M){
32. int i;
33.   if(++this->ZA.GlSto>this->ZA.GlStoMax)this->ZA.GlStoMax=this->ZA.GlSto;
34.
35.                                                            this->ZA.LiPor++;
36.   if(R-L>M){
37.     Zamien(this->Dane[(L+R)/2],this->Dane[R-1]);
38.     ZamienWarunkowo(this->Dane[L],this->Dane[R-1]);
39.     ZamienWarunkowo(this->Dane[L],this->Dane[R]);
40.     ZamienWarunkowo(this->Dane[R-1],this->Dane[R]);
41.     i=Rozdziel(L+1,R-1);
42.     QuickSortRekurMediana(L,i-1,M);
43.     QuickSortRekurMediana(i+1,R,M);
44.   }else
45.     PrzezWstawianie2QS(L,R);
46.   this->ZA.GlSto--;
47. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top