hjh132's Blog
          If a thing is worth doing it is worth doing well.
          posts - 20,comments - 9,trackbacks - 0
          public static void permute (char [] str, int low, int high)
              
          {
                  
          if (low > high)
                  
          {
                      System.out.print(str);
                      System.out.print(
          " ");
                  }

                  
          else
                  
          {
                      
          for (int i = low; i <= high; i++)
                      
          {
                          
          char[] temp = str.clone(); //temp will be str
                          temp[i] = str[low]; //with i and low
                          temp[low] = str[i]; //swapped
                          permute(temp,low+1,high);
                      }

                  }

              }

          posted on 2008-02-22 10:26 101℃太陽 閱讀(382) 評論(0)  編輯  收藏 所屬分類: 代碼民工

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 腾冲县| 安丘市| 沾化县| 白朗县| 中山市| 抚顺市| 綦江县| 浪卡子县| 丰镇市| 光山县| 石河子市| 肥西县| 阿拉善左旗| 河源市| 个旧市| 靖西县| 青龙| 台南县| 乌兰察布市| 咸阳市| 溆浦县| 突泉县| 峨眉山市| 富蕴县| 桓台县| 大洼县| 满洲里市| 商南县| 巨野县| 青铜峡市| 聂荣县| 静安区| 梓潼县| 阿克陶县| 遂川县| 岑溪市| 临城县| 长垣县| 福贡县| 彩票| 泗阳县|