![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 74
离丶殇
这个作者很懒,什么都没留下…
展开
-
期末复习之宽度优先搜索
宽度优先搜索的算法思想是比较简单了关键就是如何在有限的时间内写出正确的宽度优先搜索才是重点不过在开始还是要弄明白,看到一个题,到底是用宽度优先搜索还是用深度优先搜索,所以,我们要明白宽度优先搜索相对于深度优先搜索的优点1.方便找到最优解(一般第一个解就是最优的,而深度优先搜索必须要遍历完所有可能解才能确定)2.没有递归(所以状态转换更加直观明了)所以宽度优先搜索适合处理原创 2014-12-29 19:20:29 · 1243 阅读 · 0 评论 -
Add Two Numbers
一. Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two num原创 2017-03-13 00:18:33 · 278 阅读 · 0 评论 -
Reverse Integer
一. Reverse IntegerReverse digits of an integer. Note: The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integer overflows.Example: x = 123, return原创 2017-03-13 20:55:00 · 184 阅读 · 0 评论 -
Longest Palindromic Substring
一. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example: Input: “babad” Output: “bab” Note: “a原创 2017-03-13 21:55:23 · 136 阅读 · 0 评论 -
Palindrome Number
一. Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.Difficulty:EasyTIME:6MIN解法判断一个数字是否是回文,如果是字符串,当然很简单,因为知道字符串的长度,也能访问字符串的每一个字符。但是如果是数字就不太一样了,因为不能立刻得到数字的位数以及分别原创 2017-03-13 21:15:07 · 162 阅读 · 0 评论 -
Arithmetic Slices II - Subsequence
一. Arithmetic Slices II - SubsequenceA sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For exam原创 2017-03-21 19:35:46 · 227 阅读 · 0 评论 -
ZigZag Conversion
一. ZigZag ConversionThe string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)Example:原创 2017-03-14 00:14:34 · 171 阅读 · 0 评论 -
Longest Palindromic Subsequence
一. Longest Palindromic SubsequenceYou are given two non-empty linked lists representing two non-negative Given a string s, find the longest palindromic subsequence’s length in s. You may assume that原创 2017-03-14 22:36:33 · 303 阅读 · 0 评论 -
Longest Increasing Subsequence
一. Longest Increasing SubsequenceGiven an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subs原创 2017-03-17 00:23:20 · 175 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
一. Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Examples: Given “abcabcbb”, the answer is “abc”, which the length原创 2017-03-12 23:56:20 · 150 阅读 · 0 评论 -
Two Sum
一. Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use原创 2017-03-13 00:07:01 · 185 阅读 · 0 评论 -
Wiggle Subsequence
一. Wiggle SubsequenceA sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exist原创 2017-03-21 17:03:12 · 165 阅读 · 0 评论 -
字符串匹配
一,朴素字符串匹配原创 2014-10-13 23:03:43 · 387 阅读 · 0 评论 -
Is Subsequence
一. Is SubsequenceGiven a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 50原创 2017-03-17 21:36:44 · 216 阅读 · 0 评论 -
Increasing Triplet Subsequence
一. Increasing Triplet SubsequenceGiven an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should: Return true if there exists i, j,原创 2017-03-17 22:23:33 · 125 阅读 · 0 评论 -
数论之大数取模和最大公约数
这里大数是指超过了计算机所能原创 2014-10-09 00:47:49 · 917 阅读 · 0 评论 -
Distinct Subsequences
一. Distinct SubsequencesGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleti原创 2017-03-20 20:20:16 · 235 阅读 · 0 评论 -
Increasing Subsequences
一. Increasing SubsequencesGiven an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at le原创 2017-03-15 23:39:14 · 232 阅读 · 0 评论