![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
array
文章平均质量分 67
--asx
这个作者很懒,什么都没留下…
展开
-
LC 238. Product of Array Except Self
238. Product of Array Except SelfGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve ...原创 2018-03-12 23:00:13 · 127 阅读 · 0 评论 -
LC 53. Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] has the ...原创 2018-03-12 23:09:48 · 136 阅读 · 0 评论 -
LC 153. Find Minimum in Rotated Sorted Array
LC 153. Find Minimum in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the mini...原创 2018-03-13 08:58:30 · 122 阅读 · 0 评论 -
LC 206 Reverse a singly linked list.
Reverse a singly linked list.Input : Head of following linked list 1->2->3->4->NULLOutput : Linked list should be changed to, 4->3->2->1->NULLInput : Head of...原创 2018-03-13 15:56:16 · 154 阅读 · 0 评论 -
LC 141. Linked List Cycle
LC 141. Linked List Cycle判断是否是循环列表。方法是使用双指针,一个快指针一个慢指针,快指针每次走两格,慢指针每次走一格。如果快指针先到达列表终点则return false,如果快慢指针相遇则return true这里面涉及到为什么出现环的话,快慢指针一定会相遇的这个问题。class Solution {public: bool hasCycle(ListNode...原创 2018-03-13 17:05:30 · 114 阅读 · 0 评论