算法
Timsley
这个作者很懒,什么都没留下…
展开
-
[C语言][LeetCode][414]Third Maximum Number
[C语言][LeetCode][414]Third Maximum Number原创 2016-12-14 13:33:06 · 1253 阅读 · 0 评论 -
[C语言][LeetCode][442]Find All Duplicates in an Array
[C语言][LeetCode][442]Find All Duplicates in an Array原创 2016-12-12 10:48:31 · 909 阅读 · 0 评论 -
单链表的插入和删除操作
结构体定义:主要包含一个value和一个next指针 插入操作思路:查找尾节点,在尾节点后面插入 删除操作思路:这里的删除,主要是根据你传入的value,然后删除list对应的value节点,删除的时候,记住前面的节点和后面的节点,再链接起来就好了原创 2016-06-18 09:50:26 · 1485 阅读 · 0 评论 -
[C语言][LeetCode][82]Remove Duplicates from Sorted List II
[C语言][LeetCode][82]Remove Duplicates from Sorted List II原创 2016-04-19 19:25:28 · 783 阅读 · 0 评论 -
[C语言][LeetCode][92]Reverse Linked List II
[C语言][LeetCode][92]Reverse Linked List II原创 2016-04-19 19:17:45 · 810 阅读 · 0 评论 -
[C语言][LeetCode][86]Partition List
[C语言][LeetCode][86]Partition List原创 2016-04-19 19:11:56 · 758 阅读 · 0 评论 -
[C语言][LeetCode][61]Rotate List
[C语言][LeetCode][61]Rotate List原创 2016-04-19 09:28:38 · 579 阅读 · 0 评论 -
[C语言][LeetCode][74]Search a 2D Matrix
[C语言][LeetCode][74]Search a 2D Matrix原创 2016-04-27 22:17:24 · 771 阅读 · 0 评论 -
[C语言][LeetCode][283]Move Zeroes
[C语言][LeetCode][283]Move Zeroes原创 2016-04-27 22:03:12 · 973 阅读 · 0 评论 -
[C语言][LeetCode][119]Pascal's Triangle II
[C语言][LeetCode][119]Pascal's Triangle II原创 2016-04-27 21:52:00 · 1131 阅读 · 0 评论 -
判断单链表里面有没有环
原文链接:http://www.cnblogs.com/zhyg6516/archive/2011/03/29/1998831.html这题目还是慢有意思的。题目:0.如何判断单链表里面是否有环?算法的思想是设定两个指针p, q,其中p每次向前移动一步,q每次向前移动两步。那么如果单链表存在环,则p和q相遇;否则q将首先遇到null。这里主要理解一个问题,就转载 2016-04-14 22:14:23 · 645 阅读 · 0 评论 -
[C语言][LeetCode][142]Linked List Cycle II
[C语言][LeetCode][142]Linked List Cycle II原创 2016-04-14 21:50:56 · 906 阅读 · 0 评论 -
[C语言][LeetCode][80]Remove Duplicates from Sorted Array II
[C语言][LeetCode][80]Remove Duplicates from Sorted Array II原创 2016-12-12 14:22:10 · 489 阅读 · 0 评论 -
[C语言][LeetCode][75]Sort Colors
[C语言][LeetCode][75]Sort Colors原创 2016-12-12 16:13:08 · 483 阅读 · 0 评论 -
[C语言][LeetCode][20]Valid Parentheses
[C语言][LeetCode][238]Product of Array Except Self原创 2016-05-06 08:36:06 · 750 阅读 · 0 评论 -
[C语言][LeetCode][153]Find Minimum in Rotated Sorted Array
[C语言][LeetCode][153]Find Minimum in Rotated Sorted Array原创 2016-12-09 15:47:51 · 537 阅读 · 0 评论 -
[C语言][LeetCode][162]Find Peak Element
[C语言][LeetCode][162]Find Peak Element原创 2016-12-09 14:54:58 · 845 阅读 · 0 评论 -
[C语言][LeetCode][167]Two Sum II - Input array is sorted
[C语言][LeetCode][167]Two Sum II - Input array is sorted原创 2016-12-09 14:09:55 · 981 阅读 · 0 评论 -
[C语言][LeetCode][394]Decode String
[C语言][LeetCode][394]Decode String原创 2016-12-09 11:17:20 · 1393 阅读 · 0 评论 -
[C语言][LeetCode][225]Implement Stack using Queues
[C语言][LeetCode][225]Implement Stack using Queues原创 2016-12-09 11:11:22 · 992 阅读 · 0 评论 -
[C语言][LeetCode][232]Implement Queue using Stacks
[C语言][LeetCode][232]Implement Queue using Stacks原创 2016-12-09 11:04:57 · 834 阅读 · 0 评论 -
[C语言][LeetCode][20]Valid Parentheses
[C语言][LeetCode][20]Valid Parentheses原创 2016-12-09 10:58:05 · 698 阅读 · 0 评论 -
[C语言][LeetCode][1]Two Sum
[C语言][LeetCode][1]Two Sum原创 2016-12-09 10:50:55 · 756 阅读 · 0 评论 -
[C语言][LeetCode][448]Find All Numbers Disappeared in an Array
[C语言][LeetCode][33]Search in Rotated Sorted Array原创 2016-04-28 08:11:34 · 910 阅读 · 0 评论 -
[C语言][LeetCode][59]Spiral Matrix II
[C语言][LeetCode][59]Spiral Matrix II原创 2016-12-13 13:47:44 · 500 阅读 · 0 评论 -
[C语言][LeetCode][54]Spiral Matrix
[C语言][LeetCode][54]Spiral Matrix原创 2016-12-13 10:24:52 · 769 阅读 · 0 评论 -
[C语言][LeetCode][141]Linked List Cycle
[C语言][LeetCode][141]Linked List Cycle原创 2016-04-14 21:44:50 · 1463 阅读 · 0 评论 -
[C语言][LeetCode][160]Intersection of Two Linked Lists
[C语言][LeetCode][160]Intersection of Two Linked Lists原创 2016-04-14 21:39:58 · 708 阅读 · 0 评论 -
[C语言][LeetCode][234]Palindrome Linked List
[C语言][LeetCode][234]Palindrome Linked List原创 2016-04-14 21:30:36 · 1199 阅读 · 0 评论 -
[C语言][LeetCode][219]Contains Duplicate II
题目Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and原创 2015-08-28 22:45:07 · 1456 阅读 · 0 评论 -
[C语言][LeetCode][34]Search for a Range
题目Search for a Range Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target原创 2015-08-28 23:10:42 · 906 阅读 · 0 评论 -
[C语言][LeetCode][48]Rotate Image
题目Rotate Image You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up: Could you do this in-place?标签Array难度适中分析题目意思是给定一个n*n的矩阵,向右旋转90°C。我的做法是做两次变换原创 2015-08-28 23:25:45 · 1805 阅读 · 0 评论 -
[C语言][LeetCode][35]Search Insert Position
题目Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no dup原创 2015-08-28 23:02:42 · 1103 阅读 · 0 评论 -
[C语言][LeetCode][73]Set Matrix Zeroes
题目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.标签Array难度适中分析题目意思是给定一个m*n的矩阵,如果有一个元素为0,则将对应的行和列都置为0。这里的做法是先遍历一遍,记下为0的元素,然后再将其对应的行和列置为0。原创 2015-08-28 22:56:45 · 780 阅读 · 0 评论 -
[C语言][LeetCode][217]Contains Duplicate
题目Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return fals原创 2015-08-11 08:38:25 · 1044 阅读 · 0 评论 -
[C语言][LeetCode][189]Rotate Array
题目Rotate Array Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note: Try to come up as many solutions原创 2015-08-12 08:44:59 · 715 阅读 · 0 评论 -
[C语言][LeetCode][27]Remove Element
题目Remove Element Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t matter what you leave beyond the ne原创 2015-08-12 08:53:46 · 922 阅读 · 0 评论 -
[C语言][LeetCode][228]Summary Ranges
题目Summary Ranges Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”].标签Array难度简单分析题目意思是给定一个排好序并且没有重复的整形数组,求这原创 2015-08-16 00:57:13 · 612 阅读 · 0 评论 -
[C语言][LeetCode][26]Remove Duplicates from Sorted Array
题目Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another ar原创 2015-08-16 01:07:19 · 577 阅读 · 0 评论 -
[C语言][LeetCode][88]Merge Sorted Array
题目Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m原创 2015-08-20 08:29:19 · 893 阅读 · 0 评论