- 博客(6)
- 收藏
- 关注
原创 LeetCode Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Solution:
2014-02-26 15:37:22
376
原创 LeetCode Valid Sudoku
Valid SudokuDetermine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
2014-02-26 14:52:50
404
原创 LeetCode N-Queens II
N-Queens II Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Solution:public class Solution {
2014-02-26 14:18:29
398
原创 LeetCode N-Queens
N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the
2014-02-26 14:11:54
498
原创 LeetCode Implement strStr() --- KMP
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.KMP(“看毛片”算法)public class Solution { public String strStr(
2014-02-22 11:34:03
664
原创 LeetCode Balanced Binary Tree
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 subtrees of every node never diffe
2014-02-20 07:47:47
468
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人