Daily Archives: September 18, 2012

print parenthesis

/** * 3 pairs of ()()(), print all combination *  print ()()() ()(())…. * **/public void printParanthesis( int left, int right, int recurLev ){    char parenthesis[2] = {‘{‘, ‘}’};     Vector<char> vc = new Vector<char>();     // the first one … Continue reading

Posted in Uncategorized | Leave a comment

get all combinations

// new a vectorVector<char> combin = new Vector<char>();public void combination( char str[], int start, Vector<char> vc ){    if( str == null && str.length <= 0 )    {        return;    }     if( start == str.length -1 )    {        vc.add( str[start] );        … Continue reading

Posted in Uncategorized | Leave a comment

move robot

// move on an N*N matrix, can only left and down// how many paths. using recursive// X – current x-coordinate// Y – current y-coordinate// v – vector to hold pathpublic void robotMove( int N, int X, int Y, Vector v … Continue reading

Posted in Uncategorized | Leave a comment

Recursive Algorithm Interview Questions | Glassdoor

http://www.glassdoor.com/Interview/recursive-algorithm-interview-questions-SRCH_KT0,19.htm

Posted in Uncategorized | Leave a comment