![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 65
Desperado_Sage
这个作者很懒,什么都没留下…
展开
-
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论