- 博客(3)
- 资源 (7)
- 收藏
- 关注
原创 leetcode Word Ladder II
先用bfs得出最短路径长度,在bfs过程中,可以得到每一层有多少个结点可以到达,也就是在最短走k步的情况下,到达的结点,这样待会在求所有路径的时候就可以剪枝。。。vector edge[1000000];set censhu[10000];class Solution {public: vector > findLadders(string start, string
2013-11-25 10:16:46 734
原创 leetcode Substring with Concatenation of All Words
Substring with Concatenation of All Words 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 conca
2013-11-24 21:01:37 1084
原创 Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return nullFollow up:Can you solve it without using extra space?给定一个链表的头指针,问你能不能只用常数的空间快速判断一个链表是不是有环,如果有环
2013-11-11 20:23:37 9074 10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人