分组排序和冒泡排序

#include 
#include 
#include 
using namespace std;
 
void groupSort()
{
        srand(unsigned(time(NULL)));
        int size =rand()%20;
        int* arr=new int[size];
        for(int i=0;iarr[j])
                {
                    k=j;
                }
            }
            if(k!=i)
            {
                int temp=arr[k];
                arr[k]=arr[i];
                arr[i]=temp;
            }
        }
        cout<arr[j+1])
            {
                isright=false;
                int temp=arr[j];
                arr[j]=arr[j+1];
                arr[j+1]=temp;
            }
        }
        if(isright)
        {
            break;
        }
    }
    cout<<"after bubblesort"<>a;
    
}

你可能感兴趣的:(代码收藏,冒泡排序,分组排序)