![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
__LeeKuanYew
努力成为所从事领域的专家
展开
-
leetcode Set Matrix Zeroes
上题:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.原创 2014-09-18 09:26:27 · 505 阅读 · 0 评论 -
leetcode Binary Tree Maximum Path Sum 迭代算法
这个是leetcode的一道题,一般给的是深搜的算法原创 2014-10-13 19:29:47 · 453 阅读 · 0 评论 -
leetcode Longest Palindromic Substring 时间复杂度问o(n)的算法
先上题:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.一开始我是用动态规划原创 2014-10-11 22:02:21 · 492 阅读 · 0 评论 -
leetcode Path Sum II 关于树的后序遍历
我们利用辅助栈来进行树的houxi原创 2014-09-29 15:12:18 · 401 阅读 · 0 评论 -
leetcode Subsets II
上题:Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not cont原创 2014-09-17 18:04:18 · 358 阅读 · 0 评论 -
leetcode Word Ladder
废话少说,先上题:Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach interm原创 2014-09-01 18:01:25 · 495 阅读 · 1 评论 -
leetcode Wildcard Matching
先把题目'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string (not partial).The function prototype原创 2014-08-29 15:24:41 · 377 阅读 · 0 评论 -
leetcode Permutations
废话少说,先上题: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].解这题的思路是从数组中找一个数作为第原创 2014-09-10 16:38:06 · 334 阅读 · 0 评论 -
leetcode Permutations II
先上题:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], an原创 2014-09-10 16:44:31 · 381 阅读 · 0 评论 -
leetcode Single Number
上题:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without原创 2014-09-18 10:25:36 · 276 阅读 · 0 评论 -
leetcode Gas Station
上菜:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from stat原创 2014-09-18 10:13:47 · 349 阅读 · 0 评论 -
leetcode Reverse Linked List II
上题:Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n原创 2014-09-18 15:33:19 · 368 阅读 · 0 评论 -
leetcode Multiply Strings
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.这道题是利用string来模拟乘法,代码ru原创 2014-10-03 18:50:38 · 275 阅读 · 0 评论