You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2014-06-28 10:45:34
阅读次数:
225
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.TreeNode *createSearchTree(ListNode *&hea...
分类:
其他好文 时间:
2014-06-26 00:12:57
阅读次数:
289
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-25 23:36:53
阅读次数:
291
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:
其他好文 时间:
2014-06-25 21:00:45
阅读次数:
200
Copy List with Random Pointer Total Accepted: 12730 Total Submissions: 56262
My Submissions
A linked list is given such that each node contains an additional random pointer which could poi...
分类:
其他好文 时间:
2014-06-24 19:32:26
阅读次数:
194
早年~楔子在为“我的抵扣券”添加 按钮时,为了将文字隐掉,给节点设置了“font-size:0;”,设置后刷一下浏览器,webkit下按钮掉下去了,而其他浏览器(包括IE6/7)都正常:按理说font-size设为0,文字就不占用空间了(事实上文字确实不显示了),为什么按钮反而掉下来了呢?如果将li...
分类:
其他好文 时间:
2014-06-24 13:47:33
阅读次数:
1240
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
有时候当我们打开很多tabs选项卡时,要关闭它只能一个一个的进行关闭显然太麻烦,这时可以在选项卡的最右边添加一个按钮 实现关闭全部。代码如下:
//获取最后一个tabs 在新加的选项卡后面添加"关闭全部"
var li = $(".tabs-wrap ul li:last-child");
$("#close").remove();
li.after("<a class='tabs-inner' href='javascript:void()' onCl...
分类:
Web程序 时间:
2014-06-22 17:28:47
阅读次数:
268
Sort a linked list in O(n log n)
time using constant space complexity.
这道题目非常简短的一句话,给链表排序,看到nlogn,我们可以来简单复习一下排序。首先说一下这个nlogn的时间复杂度(根据决策树我们可以得出这个界限),是基于比较排序的最小上限,也就是说,对于没有一定范围情况的数据来说,最快的排序思路就是归并和快速排...
分类:
其他好文 时间:
2014-06-22 09:02:54
阅读次数:
250
Convert Sorted List to Binary Search Tree
Total Accepted: 12283 Total
Submissions: 45910My Submissions
Given a singly linked list where elements are sorted in ascending order, convert it...
分类:
其他好文 时间:
2014-06-21 23:57:00
阅读次数:
351