摘要: 8.1 水题8.2Imagine a robot sitting on the upper left hand corner of an NxN grid The robot canonly move in two directions: right and down How many possible paths are there forthe robot?FOLLOW UPImagine certain squares are “of limits”, such that the robot can not step on them Design an algorithm to get. 阅读全文
posted @ 2013-09-04 21:14 冰点猎手 阅读(343) 评论(0) 推荐(0)
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()" class Solution {public: DFS(string s, int left, int ri 阅读全文
posted @ 2013-09-04 20:46 冰点猎手 阅读(156) 评论(0) 推荐(0)