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℃太陽 閱讀(379) 評論(0)  編輯  收藏 所屬分類: 代碼民工

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


          網站導航:
           
          主站蜘蛛池模板: 绥棱县| 会宁县| 通化县| 乐清市| 凤台县| 乌什县| 方山县| 柳河县| 抚顺县| 镇宁| 红河县| 英德市| 塔河县| 英超| 中山市| 扬州市| 和硕县| 响水县| 历史| 红安县| 临西县| 宜州市| 呼和浩特市| 安达市| 沂水县| 武强县| 莱芜市| 清新县| 南郑县| 西乌珠穆沁旗| 日喀则市| 淳安县| 荆门市| 双峰县| 新郑市| 黑龙江省| 沙河市| 色达县| 桑植县| 建德市| 太保市|