Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2.....
分类:
其他好文 时间:
2014-07-22 22:53:35
阅读次数:
220
CSS3的强大,让人惊叹,人们在惊喜之余,又不得不为其艰难的道路感到可惜:好的标准只有得到行业浏览器的良好支持才算得上“标准”。CSS3标 准已提出数年,但是目前能实现她的浏览器并不多,虽然部分浏览器能实现部分规范,但这又有什么用呢?面对更多的兼容性问题,CSSer们只有望洋轻叹。虽 然如此,但有前...
分类:
其他好文 时间:
2014-07-19 15:20:14
阅读次数:
219
class Solution {public: ListNode *removeNthFromEnd(ListNode *head, int n) { if (head == NULL) return NULL; ListNode* pre = NULL; ...
分类:
其他好文 时间:
2014-07-18 18:24:55
阅读次数:
209
题目: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 rem...
分类:
其他好文 时间:
2014-07-07 19:01:42
阅读次数:
155
题目:Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1.....
分类:
其他好文 时间:
2014-07-01 20:34:50
阅读次数:
232
Given a linked list, remove the nth node from the end of list and return its head.
分类:
其他好文 时间:
2014-06-27 12:26:10
阅读次数:
322
??
当大多数程序员需要对一组对象进行排序的时候,首先想到的一个算法是sort。sort是一个非常不错的算法,但它也并非在任何场合下都是完美无缺的。有时候我们并不需要一个完全的排序操作。比如说,如果我们有一个存放Widget的矢量,而我们希望将质量最好的20个Widget送给最重要的顾客,按照顾客的重要程度送上不同质量的Widget,那么只需要排序出前20个最好的Widget,其他的Widget...
分类:
其他好文 时间:
2014-06-26 14:10:39
阅读次数:
185
题目:输入n个整数,找出其中最小的K个数方法一:直接std::sort,T(n) = O(nlgn)方法二:直接std::nth_element T(n) = O(n) 但是修改了原数组void MinKth(std::vector& num, int kth, std::vector& resul...
分类:
其他好文 时间:
2014-06-25 12:35:07
阅读次数:
216
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 removing the second node from the end, the...
分类:
其他好文 时间:
2014-06-22 20:02:46
阅读次数:
182