问题描述
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list....
分类:
其他好文 时间:
2014-08-31 23:05:42
阅读次数:
390
就把那段script加到head之间。DOM中document对象的write方法,将一段HTML代码或是一段文本内容输出到文档,以使浏览器可以动态处理.
分类:
Web程序 时间:
2014-08-31 15:42:31
阅读次数:
199
HTTP协议的主要特点可概括如下: 1.支持客户/服务器模式。 2.简单快速:客户向服务器请求服务时,只需传送请求方法和路径。请求方法常用的有GET、HEAD、POST。每种方法规定了客户与服务器联系的类型不同。由于HTTP协议简单,使得HTTP服务器的程序规模小,因而通信速度很快。 3.灵活:HT...
分类:
其他好文 时间:
2014-08-31 13:14:21
阅读次数:
308
#include #include using namespace std;void reverse(char* str) { int length = strlen(str); char* str_head = str; char* str_tail = &str[length-1]; w...
分类:
其他好文 时间:
2014-08-31 06:03:10
阅读次数:
253
<html>
<head>
<title>TEST</title>
<style>
body,td{
????font-family:?verdana,?arial,?helvetica,?sans-serif;
????font-size:?12px;
}
</style>
<script?type="text/javascript">
????var...
分类:
其他好文 时间:
2014-08-30 23:14:40
阅读次数:
482
访问页面元素访问页面元素通常的一个做法是给标签加上一个id,然后可以通过getElementById()函数来实现,如:...var sceneDescription = document.getElementById("scenetext")还有一种方法是通过标签的名字来进行访问,getEleme...
分类:
编程语言 时间:
2014-08-30 22:55:30
阅读次数:
223
题意:二维坐标系里有 n 个点 (i, ai), ai >= 0,从 (i, ai)到(i, 0)划竖线,共有 n 条竖线。
找出两条竖线,使得它们构成的矩形的面积最大,矩形的高取决于最短的竖线。
思路:贪心
从首尾两个下标head 和trail 处开始扫描,用一个变量 maxArea 保持当前最大的矩形面积。
如果head 指向的竖线短于 trail 的,则右移 head
否则左移 trail
计算面积,更新 maxArea
复杂度:时间O(n),空间O(1)
int maxArea(vector<in...
分类:
其他好文 时间:
2014-08-30 16:27:49
阅读次数:
223
首先介绍DOM里常见的三种节点类型(总共有12种,如docment):元素节点,属性节点以及文本节点,例如head,其中h2是元素节点,class是属性节点,head是文本节点,在这里你可以说 h2这个元素节点包含一个属性节点和一个文本节点。其实几乎所有HTML的标签都是元素节点,而id, ti.....
分类:
其他好文 时间:
2014-08-30 15:03:59
阅读次数:
184
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-08-30 08:49:59
阅读次数:
210
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-08-30 01:11:08
阅读次数:
286