LeetCode算法
文章平均质量分 57
月zhy
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
算法练习1.Two Sum 数组两个和为目标值的下标(map)
Two Sum 给定一个目标整数target,找出数组中和为target的两个数的下标 C++: class Solution { public: vector twoSum(vector& nums, int target) { vector solve; for(int i = 0 ; i { for(i原创 2016-04-30 09:18:35 · 675 阅读 · 0 评论 -
算法练习2.Add Two Numbers 反向小数链表表示相加
2. Add Two Numbers https://leetcode.com/problems/add-two-numbers/ You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their原创 2016-04-30 09:23:45 · 478 阅读 · 0 评论 -
算法练习3.Longest Substring Without Repeating Characters 最长不重复子字符串(map)
3. Longest Substring Without Repeating Characters https://leetcode.com/problems/longest-substring-without-repeating-characters/ Examples: Given "abcabcbb", the answer is "abc",whic原创 2016-04-30 09:30:34 · 380 阅读 · 0 评论 -
算法练习4.Median of Two Sorted Arrays两个有序数组的中位数(递归、分治)
4. Median of Two Sorted Arrays https://leetcode.com/problems/median-of-two-sorted-arrays/ There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the t原创 2016-05-09 22:12:17 · 313 阅读 · 0 评论 -
算法练习5. Longest Palindromic Substring 最长回文子字符串(Manacher算法)
5. Longest Palindromic Substring https://leetcode.com/problems/longest-palindromic-substring/ Given a string S, find the longest palindromic substring in S. You may assume that the maximum len原创 2016-05-09 22:18:13 · 553 阅读 · 0 评论 -
算法练习6. ZigZag Conversion 把一串字符反N方向n行排列
6. ZigZag Conversion The 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 legibi原创 2016-05-09 22:22:03 · 334 阅读 · 0 评论 -
算法练习7. Reverse Integer 把整数反向输出
7. Reverse Integer https://leetcode.com/problems/reverse-integer/ Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 把整数反向输出: class Solution原创 2016-05-09 22:45:08 · 595 阅读 · 0 评论
分享