![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCodeOJ
John_hit
哈尔滨工业大学ITNLP实验室
展开
-
[LeetCode OJ]11. Container With Most Water
[LeetCode OJ]11. Container With Most WaterGiven n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of lin原创 2016-03-02 23:18:10 · 296 阅读 · 0 评论 -
[LeetCodeOJ] Reverse Integer
[LeetCodeOJ] Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321click to show spoilers.Subscribe to see which companies asked this questionclass S原创 2016-03-02 22:50:10 · 234 阅读 · 0 评论 -
[LeetCode OJ] 19. Remove Nth Node From End of List
[LeetCode OJ] 19. Remove Nth Node From End of ListGiven 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 removin原创 2016-03-02 23:15:44 · 222 阅读 · 0 评论 -
[LeetCode OJ]16. 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly原创 2016-03-02 23:38:27 · 240 阅读 · 0 评论 -
滑雪(记忆化)
Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 81转载 2016-03-23 00:26:29 · 303 阅读 · 0 评论 -
使用单链表反转的递归和非递归实现方式
//思路为将节点从前到后依次放到表头,最后最后的节点到了最前面,最前面的节点到了最后面 ListNode * ReverseList(ListNode * head) { //如果链表为空或者链表中只有一个元素 if(head==NULL || head->m_pNext==NULL) return head; ListNode * p=he转载 2016-03-12 23:32:02 · 520 阅读 · 0 评论