Sudoku Solver
Total Accepted: 11752 Total
Submissions: 56537My Submissions
Write a program to solve a Sudoku puzzle by filling the empty cells.
Empty cells are indicated by the character...
分类:
其他好文 时间:
2014-09-06 22:37:04
阅读次数:
244
整合两道差不多的题目放上来,其中第一题是第二题的基础。
1.
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two...
分类:
其他好文 时间:
2014-09-06 21:21:03
阅读次数:
279
public class Solution { public List preorderTraversal(TreeNode root) { List result = new ArrayList(); Stack nodeStack = new Stack();...
分类:
其他好文 时间:
2014-09-05 22:17:42
阅读次数:
246
Problem Description:
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree s...
分类:
其他好文 时间:
2014-09-05 19:57:31
阅读次数:
205
Binary Tree Level Order Traversal II
Total Accepted: 16983 Total
Submissions: 54229My Submissions
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie...
分类:
其他好文 时间:
2014-09-05 18:22:41
阅读次数:
212
Binary Tree Level Order Traversal
Total Accepted: 20571 Total
Submissions: 66679My Submissions
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left t...
分类:
其他好文 时间:
2014-09-05 18:22:21
阅读次数:
271
Problem Description:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
分析:很容易想到的一种解法是将链表中所有的元素保存到数组中,然后每次取中间值进行构造,时间复杂度为O(n),空间复杂度为O(n)。具体...
分类:
其他好文 时间:
2014-09-05 18:14:11
阅读次数:
223
要说slave_skip_errors选项,就不得不提mysql的replication机制,总的来说它分了三步来实现mysql主从库的同步master将改变记录到二进制日志(binary log)中(这些记录叫做二进制日志事件,binary log events);slave将master的bin...
分类:
数据库 时间:
2014-09-05 18:03:51
阅读次数:
380
Sum Root to Leaf Numbers
Total Accepted: 20237 Total
Submissions: 67979My Submissions
Given a binary tree containing digits from 0-9 only,
each root-to-leaf path could represent a numbe...
分类:
其他好文 时间:
2014-09-05 16:12:01
阅读次数:
200
Binary Tree Postorder Traversal
Total Accepted: 28560 Total
Submissions: 92333My Submissions
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given...
分类:
其他好文 时间:
2014-09-05 16:09:01
阅读次数:
172