zip is a built-in function that takes two or more sequence and ‘zips’ them into a list of tuples, where each tuple contains one element from each sequ...
分类:
其他好文 时间:
2014-07-22 22:53:14
阅读次数:
269
Node类型:javascript 所有节点均继承于此。 nodeType: Node.ELEMENT_NODE(1)?//fruquently?used
Node.ATTRIBUTE_NODE(2)
Node.TEXT_NODE(3)?//fruquently?used
Node.CDATA_SECTION_NODE(4)
Node.ENTITY_PRE...
分类:
其他好文 时间:
2014-07-21 10:26:56
阅读次数:
328
Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, r...
分类:
其他好文 时间:
2014-07-21 09:38:07
阅读次数:
199
对于一个二叉搜索树, 要想找到这棵树的最小元素值, 我们只需要从树根开始, 沿着left 孩子指针一直走, 知道遇到NULL(即走到了叶子), 那么这个叶子节点就存储了这棵二叉搜索树的最小元素。 同理, 从根节点开始, 沿着right 孩子指针, 最终找到的是最大关键字的节点。
也就是说寻找BST最小关键字的元素和最大关键字的元素的代码是对称的。伪代码如下:
TREE_MINIMUM(x...
分类:
编程语言 时间:
2014-07-21 09:28:27
阅读次数:
241
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2014-07-21 09:08:29
阅读次数:
209
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2014-07-21 00:39:31
阅读次数:
249
nth_element
------------------------------------------------------------------------------
描述:重新排序,使得[nth,last)内没有任何一个元素小于[first,nth)内的元素,
但对于[first,nth)和[nth,last)两个子区间内的元素次序则无任何保证。
思路:
1.以 median-of-3-partition 将整个序列分割为更小的左、右子序列
2.如果 nth 迭代器落于左序列,就再对左子...
分类:
其他好文 时间:
2014-07-20 23:20:34
阅读次数:
279
响应事件:
1.设置一个html标记
Ext JS 4 Cookbook
2.使用get函数获取此标记对象
var el = Ext.get('my-div');
3.将响应函数和对象的事件绑定
el.on('click', function(e, target, options){
alert('The Element was clicked!');
alert(this.id);
...
分类:
Web程序 时间:
2014-07-20 22:18:13
阅读次数:
290
今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的,因为c++版的代码网上比较多,所以就只分享一下Python的代码吧,刚学完Python的基本语法,做做LeetCode的题目还是不错的,对以后找工作面试也有帮助!
刚开始就从AC率最高的入手吧!
1.Given an array of integers, every element appe...
分类:
编程语言 时间:
2014-07-20 15:27:41
阅读次数:
262
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-07-19 22:19:36
阅读次数:
202