Android with Paint,canvas drawing

Source: Internet
Author: User

Tag:c++    Quick sort    

#include <iostream>using namespace std;//quick Sort//In addition, if the array is a reference pass can be inferred by the function template's argument to automatically get its length template<typename T,     int n> void Printarr (T (&arr) [N]) {int i = 0;   while (i<n) {cout << arr[i] << "";   i++; } cout <<endl;} void swap (int &p,int &q) {int temp = p;p= q;q=temp;} int getindex (int arr[],int nlow,int nhigh) {int ntemp = Arr[nhigh];int j = nlow-1;for (int i=nlow;i<nhigh;i++) {if (arr [i] <= ntemp) {J=j+1;swap (arr[j],arr[i]);}} Swap (Arr[j+1],arr[nhigh]); return j+1;} void QuickSort (int arr[],int nlow,int nhigh) {if (Nlow < Nhigh) {int nIndex = GetIndex (Arr,nlow,nhigh); QuickSort (arr, NLOW,NINDEX-1); QuickSort (Arr,nindex + 1,nhigh);}} int main () {#ifdef __cpluspluscout << "C + +" <<endl; #elsecout << "C" <<endl; #endifint arr[] = {    52,49,80,36,14,75,58,56,57,78,42,22,22,44}; QuickSort (arr,0,sizeof (arr)/sizeof (arr[0));p Rintarr (arr); return 0;}

Http://www.cnblogs.com/pugang/archive/2012/06/27/2565093.html

See the link above for specific logic

Android with Paint,canvas drawing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.