摘要: 这里主要谈及强连通分量(以下简称SCC,strongly connected component)三种常见的求法(以下涉及的图均为有向图),即Kosaraju、Tarjan和Gabow。三种算法背后的基础思想都是DFS,只是它们通过DFS获得了不同的信息。各位大哥大姐继续往下读之前,最好对DFS相关... 阅读全文
posted @ 2014-12-02 22:17 Jessica程序猿 阅读(3726) 评论(0) 推荐(0) 编辑
摘要: Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil... 阅读全文
posted @ 2014-12-02 16:33 Jessica程序猿 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The... 阅读全文
posted @ 2014-12-02 14:11 Jessica程序猿 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl... 阅读全文
posted @ 2014-12-02 11:20 Jessica程序猿 阅读(286) 评论(0) 推荐(0) 编辑
摘要: You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenati... 阅读全文
posted @ 2014-12-02 09:35 Jessica程序猿 阅读(237) 评论(0) 推荐(0) 编辑