You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-05-01 22:08:19
阅读次数:
366
/*#include #include #define N 100#define LIM
-100000000float det(float a[N][N],int n){ if(n==1) return a[0][0]; if(n==2)
return a[...
分类:
其他好文 时间:
2014-05-01 20:26:45
阅读次数:
322
Merge k Sorted Lists
Total Accepted: 9746 Total
Submissions: 41674My Submissions
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity....
分类:
其他好文 时间:
2014-05-01 17:11:32
阅读次数:
234
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
分析:暂时不用...
分类:
其他好文 时间:
2014-05-01 17:06:52
阅读次数:
348
Problem 1:Given a set of distinct integers, S,
return all possible subsets.Note:Elements in a subset must be in non-descending
order.The solution set ...
分类:
其他好文 时间:
2014-05-01 09:43:43
阅读次数:
414
Given an array of integers, find two numbers
such that they add up to a specific target number.The function twoSum should
return indices of the two nu...
分类:
其他好文 时间:
2014-05-01 08:35:40
阅读次数:
443
<?php
$filename="胡主席好.pdf";
if(!file_exists($filename))
{
echo "不存在此文件";
return;
}
$fp=fopen($filename,"r");
$file_size=filesize($filename);
//配置头文件
/...
分类:
Web程序 时间:
2014-04-29 13:42:20
阅读次数:
356
在项目中有时需要验证用户是否以post方式提交。下面是验证源码:
public boolean checkMethod(String method) {
if (request.getMethod().equalsIgnoreCase(method)) {
return true;
}
else {
...
分类:
Web程序 时间:
2014-04-29 13:34:20
阅读次数:
350
类--类的定义和声明【下】三、关于类定义的更多内容【接上】//P374 习题12.8
class Sales_item
{
public:
double avg_price() const;
bool same_isbn(const Sales_item &rhs) const
{
return rhs.isbn == isbn;
}
Sa...
分类:
编程语言 时间:
2014-04-29 13:28:21
阅读次数:
324
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
思路同十进制的大数相加。代码如下:
class Solution {
public:
string addBinary(string a, str...
分类:
其他好文 时间:
2014-04-29 13:12:20
阅读次数:
328