Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given
s = “leetcode”,
dict = [“leet”, “co...
分类:
其他好文 时间:
2015-07-02 01:08:01
阅读次数:
126
原题如下:
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).我的算法:
1. 首先获得树的高度
2. 层序递归遍历二叉树实现如下:package leet...
分类:
其他好文 时间:
2015-06-29 15:02:29
阅读次数:
130
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2015-06-01 22:47:24
阅读次数:
159
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given
s = “leetcode”,
dict = [“leet”, “...
分类:
其他好文 时间:
2015-05-07 18:56:26
阅读次数:
114
leet code Sort Listleet code Sort List对链表使用快慢指针归并排序Sort ListSort a linked list in O(n log n) time using constant space complexity./** * Definition for...
分类:
其他好文 时间:
2015-04-22 22:12:40
阅读次数:
123
1 题目Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica...
分类:
其他好文 时间:
2015-04-22 22:06:33
阅读次数:
189
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]....
分类:
其他好文 时间:
2015-04-21 20:45:08
阅读次数:
136
1 题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter...
分类:
其他好文 时间:
2015-04-16 19:19:32
阅读次数:
100
题目:
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given
s = “leetcode”,
dict = [“leet...
分类:
其他好文 时间:
2015-04-06 21:53:21
阅读次数:
163
1 题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sin...
分类:
其他好文 时间:
2015-04-06 17:01:05
阅读次数:
112