permutations of a string using iteration

前端 未结 7 1845
迷失自我
迷失自我 2020-12-16 14:36

I\'m trying to find permutation of a given string, but I want to use iteration. The recursive solution I found online and I do understand it, but converting it to an iterati

7条回答
  •  粉色の甜心
    2020-12-16 14:48

    package vishal villa;
    
    import java.util.Scanner;
    
    public class Permutation {
        static void result( String st, String ans)
        {
    
            if(st.length() == 0)
                System.out.println(ans +" ");
    
            for(int i = 0; i

提交回复
热议问题