C++
文章平均质量分 74
lifi_sysu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
# 324. Wiggle Sort II
标签(空格分隔): leetcode 原题 分析 需要注意的一些细节 代码 1. 原题Given an unsorted array nums, reorder it such that nums[0] < nums1 > nums[2] < nums[3]….Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is原创 2017-09-17 14:54:29 · 316 阅读 · 0 评论 -
leetcode 8. String to Integer (atoi)
leetcode 8. String to Integer (atoi)标签(空格分隔): leetcodeleetcode 8 String to Integer atoi 原题意思 分析 值得注意的溢出问题 代码 1. 原题意思:实现atoi() 实现将字符串转化为int型整数,至于多少种情况自己考虑。。2.分析: 空的字符串: “” ,判定为0 普通的正负数: “-123”, “123”, “原创 2017-09-09 13:57:48 · 398 阅读 · 0 评论 -
561. Array Partition I
561. Array Partition I标签(空格分隔): leetcodeArray Partition I 原题 分析 代码 1. 原题Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn)原创 2017-09-11 14:59:50 · 199 阅读 · 0 评论 -
667. Beautiful Arrangement II
标签(空格分隔): leetcode 原题 分析 代码实现过程中的一些坑 代码 1.原题Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requirement原创 2017-09-11 22:00:50 · 226 阅读 · 0 评论 -
5. Longest Palindromic Substring(最长回文子串)
原题 分析 代码1. 原题Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.2. 分析: 求一个字符串中的最长回文,最容易想到的一种就是:使用循环,在 str[ i ] 这个字符的时候, 不断同时向前和向后一样长的单位直到原创 2017-09-20 21:11:19 · 269 阅读 · 0 评论 -
53. Maximum Subarray
标签(空格分隔): leetcode 原题 分析: 题目要求在一个连续数组中找到一个子数组,是的子数组的元素的和最大。可以使用暴力解答, n 个数一共有 C2nC_{n}^{2} 种选择,分别计算这 C2nC_{n}^{2} 种选择的结果然后求最大值,但是时间复杂度 O(n2)O(n^2),这道题不通过。。 可以使用分治算法: > 假设数组A的low, mid, high分别表示数组相应原创 2017-10-21 15:22:47 · 191 阅读 · 0 评论
分享