摘要: BFS UndirectedGraphNode *cloneGraph(UndirectedGraphNode *node) { // Note: The Solution object is instantiated only once and is reused by each test case. if(node==NULL) return NULL; map nmap; UndirectedGraphNode* copynode = new UndirectedGraphNode(node->label... 阅读全文
posted @ 2013-10-24 22:42 summer_zhou 阅读(108) 评论(0) 推荐(0) 编辑
摘要: int minCut(string s) { // Note: The Solution object is instantiated only once and is reused by each test case. if(s.empty()) return 0; int n = s.size(); vector> bPalin(n,vector(n,false)); int i,j; for(i=0;i=0;i--) for(j=i+2;j dp(n)... 阅读全文
posted @ 2013-10-24 16:41 summer_zhou 阅读(126) 评论(0) 推荐(0) 编辑