Remove Duplicates from Sorted Array
题目:
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for...
分类:
其他好文 时间:
2015-06-10 19:32:23
阅读次数:
133
js中的几种创建对象的方式。一共有5种:一 , 工厂方式var lev = function() { return this.age;};function Parent() { var child = new Object(); child.name = '小芳'; child.age = 30; ...
分类:
Web程序 时间:
2015-06-10 19:17:09
阅读次数:
117
代码第一版 :#include using namespace std;int max(int a,int b){ if(a>=b)return a; else return b;}int cut_rod(int *p,int n){ int q=NULL; if(n==0)...
分类:
其他好文 时间:
2015-06-10 18:56:12
阅读次数:
111
Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[...
分类:
其他好文 时间:
2015-06-10 17:30:10
阅读次数:
106
public class SqStack {
public int[] data;
public int top;
public SqStack() {
data = new int[20];
top = -1;
}
public boolean empty() {
return top == -1;
}
public boolean push(int e) {...
分类:
其他好文 时间:
2015-06-10 17:22:29
阅读次数:
110
Reverse Nodes in k-Group
题目:
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes...
分类:
其他好文 时间:
2015-06-10 17:20:50
阅读次数:
95
C#中函数的定义修饰符返回类型函数名(参数列表)关于返回类型1:如果函数的返回类型不是void,则在函数体中必须要有return语句进行返回值,而且返回值的类型要么是函数的返回类型,要么可以隐式转换成函数的返回类型,否则就需要进行强制转换成函数的返回类型。2:如果函数的返..
$(‘#cc‘).combobox({
formatter: function(row){
var opts = $(this).combobox(‘options‘);
return row[opts.textField];
}
});
上面是jQuery easyUI官网上找到的。
现在我们要做成如下这样的: 则可以通过...
分类:
Web程序 时间:
2015-06-10 14:23:36
阅读次数:
146
【申明:本文仅限于自我归纳总结和相互交流,有纰漏还望各位指出。 联系邮箱:Mr_chenping@163.com】
题目:
最大公约数问题
题目分析:
编程之美上的经典算法
算法实现:
#include
int gcd(int x, int y)
{
return ((!y) ? x: gcd(y, x%y));
}
int main(int argc, c...
分类:
编程语言 时间:
2015-06-10 14:17:21
阅读次数:
130
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:要求合并两个排好序的链表。开始我们初始化头front和尾tail,然后从两个单链表的头部比较两个单链表,两链表同时...
分类:
其他好文 时间:
2015-06-10 14:11:34
阅读次数:
135