这回要求的是第k小的元素,参考了ljl大神的模板,orz 1 //insert 插入 2 //remove 删除 3 //_find 查找 4 //kth 返回root为根的树中第k小的元素 5 //treap插入、删除、查询时间复杂度均为O(logn) 6 #include 7 #...
分类:
其他好文 时间:
2014-10-28 19:55:27
阅读次数:
283
1.Ext.getext里用来获得element的函数,用途还算广泛,可以通过不少途径获得咱们需要的element,而这个element包括很多有趣的功能。element跟document.getElementByid('mydiv')得到的dom对象不一样的,虽然你还可以使用老方法获得指定的id元...
分类:
其他好文 时间:
2014-10-28 15:14:31
阅读次数:
312
问题描述:
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->3, return 1->2->3.
思路:遍历链表,通过两个指针...
分类:
其他好文 时间:
2014-10-28 12:12:23
阅读次数:
143
Insert or update an element in mapm:m[key] = elemRetrieve an element:elem = m[key]Delete an element:delete(m, key)Test that a key is present with a tw...
分类:
其他好文 时间:
2014-10-28 00:39:53
阅读次数:
243
优先队列头文件#include 默认优先为从大到小优先。自定义优先级 1 struct cmpmin{ //按从小到大 2 3 // 因为标准库默认使用元素类型的b; //所以规定小的元素...
分类:
其他好文 时间:
2014-10-28 00:24:09
阅读次数:
243
一、XML解析的简介
1、一般来说xml解析的方式有两种,Dom与SAX,且各有优缺点。pull是第三种方法见:pull解析XML
1)DOM:dom对象树
①、整个XML放入内存,转换为Document对象;
②、每个元素,转换成Element对象
③、文本,转换成Text对象
④、属性,转换成Attribute对象
优缺点:元素的CRUD比较简单,但是内存消耗大,大的xml文...
分类:
其他好文 时间:
2014-10-27 23:08:30
阅读次数:
445
Add Instruction Node Every valid XML must contain processing instruction. XML is widely used for HTML, SVG, XLS etc. So make sure your XML file has valid instruction of its type and encoding. The f...
分类:
其他好文 时间:
2014-10-27 21:27:17
阅读次数:
155
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use...
分类:
其他好文 时间:
2014-10-27 17:33:44
阅读次数:
223
挺简单的,没什么好说的public class Solution { public int removeElement(int[] A, int elem) { int j=0; for(int i=0;i<A.length;i++){ if(...
分类:
其他好文 时间:
2014-10-27 14:13:22
阅读次数:
168
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2014-10-27 12:39:09
阅读次数:
192