src/Recursion_Course/recursion_get.java
public static ArrayList<String> mazePathD(int cr, int cc, int er, int ec) {

		if (cr == er && cc == ec) {
			ArrayList<String> br = new ArrayList<String>();
			br.add("\n");
			return br;
		}

		if (cr > er || cc > ec) {
			ArrayList<String> nr = new ArrayList<String>();
			return nr;
		}

		ArrayList<String> mr = new ArrayList<String>();

		ArrayList<String> rrh = mazePathD(cr, cc + 1, er, ec);

		for (String val : rrh) {
			mr.add("H" + val);
		}

		ArrayList<String> rrv = mazePathD(cr + 1, cc, er, ec);

		for (String val : rrv) {
			mr.add("V" + val);
		}

		ArrayList<String> rrd = mazePathD(cr + 1, cc + 1, er, ec);

		for (String val : rrd) {
			mr.add("D" + val);
		}

		return mr;

	}
//	print all possible maze path (with diagonal)
print all possible maze path (with diagonal)
print all possible maze path ( with diagonal )
public static ArrayList<String> mazePathD(int cr, int cc, int er, int ec) {
		if (cr == er && cc == ec) {
			ArrayList<String> br = new ArrayList<String>();
			br.add("\n");
			return br;
		}
		if (cr > er || cc > ec) {
			ArrayList<String> nr = new ArrayList<String>();
			return nr;
		}
		ArrayList<String> mr = new ArrayList<String>();
		ArrayList<String> rrh = mazePathD(cr, cc + 1, er, ec);
		for (String val : rrh) {
			mr.add("H" + val);
		}
		ArrayList<String> rrv = mazePathD(cr + 1, cc, er, ec);
		for (String val : rrv) {
			mr.add("V" + val);
		}
		ArrayList<String> rrd = mazePathD(cr + 1, cc + 1, er, ec);
		for (String val : rrd) {
			mr.add("D" + val);
		}
		return mr;
	}
public static ArrayList < String > mazePathD ( int cr , int cc , int er , int ec ) { if ( cr == er && cc == ec ) { ArrayList < String > br = new ArrayList < String > ( ) ; br . add ( "\n" ) ; return br ; } if ( cr > er || cc > ec ) { ArrayList < String > nr = new ArrayList < String > ( ) ; return nr ; } ArrayList < String > mr = new ArrayList < String > ( ) ; ArrayList < String > rrh = mazePathD ( cr , cc + 1 , er , ec ) ; for ( String val : rrh ) { mr . add ( "H" + val ) ; } ArrayList < String > rrv = mazePathD ( cr + 1 , cc , er , ec ) ; for ( String val : rrv ) { mr . add ( "V" + val ) ; } ArrayList < String > rrd = mazePathD ( cr + 1 , cc + 1 , er , ec ) ; for ( String val : rrd ) { mr . add ( "D" + val ) ; } return mr ; }
print all possible maze path (with diagonal)
print all possible maze path ( with diagonal )