Fork me on GitHub
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页
摘要: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading 阅读全文
posted @ 2017-04-08 20:59 hellowOOOrld 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After remo 阅读全文
posted @ 2017-04-08 19:58 hellowOOOrld 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to 阅读全文
posted @ 2017-04-08 17:12 hellowOOOrld 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. 两种办法: 1.头插法。 2.递归。 参考: https://discuss.leetcode.com/topic/13317/accepted-c-solutions-both-iteratively-and-recursively 阅读全文
posted @ 2017-04-08 14:44 hellowOOOrld 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5 阅读全文
posted @ 2017-04-08 12:46 hellowOOOrld 阅读(392) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,3], Your function s 阅读全文
posted @ 2017-04-07 21:11 hellowOOOrld 阅读(867) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3-> 阅读全文
posted @ 2017-04-07 18:55 hellowOOOrld 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 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? 思路:先翻转再对换 1 阅读全文
posted @ 2017-04-07 09:35 hellowOOOrld 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2-> 阅读全文
posted @ 2017-04-06 16:36 hellowOOOrld 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 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]. Not 阅读全文
posted @ 2017-04-06 15:44 hellowOOOrld 阅读(107) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页