<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          冒泡排序與插入排序

          作者: 時(shí)間:2016-11-11 來(lái)源:網(wǎng)絡(luò) 收藏
          void BubbleSort(unsigned int *pArray,unsigned char arr_len)

          {
          unsigned int temp;
          unsigned char i,j;
          for( i=0; i for( j=i+1; j if( pArray[i]>pArray[j])
          {
          temp = pArray[i];
          pArray[i]= pArray[j];
          pArray[j]= temp;
          }
          }

          本文引用地址:http://www.ex-cimer.com/article/201611/316732.htm


          void InsertSort(unsigned int *pArray,unsigned char arr_len)
          {
          unsigned int temp;
          char i,j;
          for( i=1; i {
          temp=pArray[i];
          j=i-1;
          while((j>=0)&&(temp<=pArray[j]))
          {

          pArray[j+1]=pArray[j];
          j--;
          }
          pArray[j+1]=temp;
          }
          }



          關(guān)鍵詞: 冒泡排序插入排

          評(píng)論


          技術(shù)專(zhuān)區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();