题目Remove Duplicates from Sorted List通过率34.4%难度EasyGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example...
分类:
其他好文 时间:
2014-12-21 20:38:34
阅读次数:
165
项目中有时候会不用jquery这么好用的框架,需要自己封装一些事件对象和事件处理程序,像封装AJAX那样;这里面考虑最多的还是浏览器的兼容问题,原生js封装如下:var EventUtil={ //节点、事件名、事件处理函数 addHanler:function(element,type,h...
分类:
Web程序 时间:
2014-12-20 23:20:24
阅读次数:
190
给定一个数组,假设下标0左边的为负无穷,下标size的也为负无穷。找到峰值所在。峰值是一定存在的,因为下标0大于左边了,如果不存在那么下标1就要大于0的,一次类推下一个都要大于上一个的。那么知道size-1的时候还是大于size-2,又因为size是负无穷,那么size-1就是峰值了。所以峰值一定存...
分类:
其他好文 时间:
2014-12-20 19:30:29
阅读次数:
157
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may ...
分类:
其他好文 时间:
2014-12-20 18:20:25
阅读次数:
128
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using ext...
分类:
其他好文 时间:
2014-12-19 19:14:19
阅读次数:
141
说要写成对数时间复杂度,算了想不出来,写个O(n)的水了class Solution {public: int findPeakElement(const vector &num) { int len = num.size(); if (len last) { ...
分类:
其他好文 时间:
2014-12-19 17:13:26
阅读次数:
115
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.
The array may contain multiple peaks, in ...
分类:
其他好文 时间:
2014-12-19 15:50:51
阅读次数:
135
C#中可以让Webbrowser运行Javascript脚本来实现各种自动化操作,比如点击网页上的按钮,输入用户名密码等等。代码也很简单:>>>>>>>>>>>>>>>>>>>>方法一:只需要先获取HtmlElement,然后对获取的element进行操作即可,比如:HtmlElementbtn=w...
分类:
编程语言 时间:
2014-12-19 13:00:07
阅读次数:
291
为了方便表示或是指定一个组件的名称,我们通常会使用id或者itemId进行标识命名。(推荐尽量使用itemId,这样可以减少页面唯一标识而产生的冲突)
id:
id是作为整个页面的Component的唯一标识,这也意味着在整个页面中只允许有唯一一个名称的id,同时这里的Component的id也将变为element中的id,所以如果出现了两个,页面将会出现崩塌变形等等不可以想象的问...
分类:
Web程序 时间:
2014-12-19 12:09:24
阅读次数:
167
C# 6.0introduced a new operator named,nameofthat accepts the name of code element and returns a string literal of the same element. Thenameofoperator ...
分类:
Windows程序 时间:
2014-12-19 12:02:30
阅读次数:
2365