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-09-13 20:01:15
阅读次数:
205
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2014-09-13 20:00:25
阅读次数:
195
document方法:getElementById(id)返回指定结点的引用getElementsByTagName_r(name)返回文档中所有匹配的元素的集合createElement_x(name)创建指定类型的新结点createTextNode(text)创建一个纯文本结点element方法...
分类:
其他好文 时间:
2014-09-13 09:21:34
阅读次数:
167
LinkedList也像ArrayList一样,实现了List接口,但是他执行某些操
(在List中间的插入和删除)时比ArrayList更高效,但是随即访问方面差一些
方法说明:
getFirst()和element()完全一样,他们都返回列表的头
(第一个元素)而并不删除它们,如果List为空则抛出NotSuchElementException
peek()方法与这两个稍有差...
分类:
其他好文 时间:
2014-09-13 00:50:34
阅读次数:
268
(一)DOM扩展对DOM的主要的扩展是SelectorsAPI(选择符API)和HTML5,还有一个Element Travesal规范。1.选择符APIjQuery的核心就是通过CSS选择符查询DOM文档取得元素的引用,从而抛开了getElementById( ) 和 getElementsByT...
分类:
编程语言 时间:
2014-09-12 18:59:33
阅读次数:
246
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:
其他好文 时间:
2014-09-12 13:26:43
阅读次数:
145
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:
其他好文 时间:
2014-09-12 05:41:53
阅读次数:
192
仅提供个人的一种解题思路,未必是最优,仅供各位参考!
/**
*
*
* ClassName SolutionBestTimeToBuyAndSellStock
*
*
* Description Say you have an array for which the ith element is the price of a given stock on day i....
分类:
其他好文 时间:
2014-09-11 22:28:42
阅读次数:
235
给出两点,求经过这两点的正n边形的最小面积
大白鼠上说要注意精度,我没觉得精度有什么影响,然后就过了
我的做法:
相当于这两点构成的线段是正n边形的最长弦
我的代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using names...
分类:
其他好文 时间:
2014-09-11 22:26:22
阅读次数:
215
在写html跟css的时候,我们会给一些标签起一些class的名字,但是在写js的时候可能也会通过cssName操作css样式,如果只是平常的element.className = "value";的话,那么之前的定义的class会被置空,css中的样式就会受到影响,所以,在js中如果有微调css的...
分类:
Web程序 时间:
2014-09-11 20:50:22
阅读次数:
1474