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
var asd = xx||2;
//如果xx是undefined或null或""空字符串,则asd的值为2,反之为xx。
分类:
其他好文 时间:
2014-05-01 21:07:59
阅读次数:
277
/*#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
class testsetandget: kk = {}; def __getitem__(self,
key): return self.kk[key]; def __setitem__(self, key, value): self.kk[key] =
value;a = testset...
分类:
编程语言 时间:
2014-05-01 20:16:13
阅读次数:
449
/**js Unicode编码转换*/vardecToHex =function(str)
{varres=[];for(vari=0;i < str.length;i++)
res[i]=("00"+str.charCodeAt(i).toString(16)).slice(-4);return"...
分类:
Web程序 时间:
2014-05-01 19:36:51
阅读次数:
427
递归:就是出现这种情况的代码: (或者说是用到了栈)解答树角度:在dfs遍历一棵解答树
优点:结构简洁缺点:效率低,可能栈溢出递归的一般结构:1 void f() {2 if(符合边界条件) {3 ///////4 return;5 }6 7
...
分类:
其他好文 时间:
2014-05-01 19:20:17
阅读次数:
343
一、 序言
上一篇文章中,给出了 trie 树的一个实现。可以看到,trie 树有一个巨大的弊病,内存占用过大。
本文给出另一种数据结构来解决上述问题---- Ternary Search Tree (三叉树)
二、数据结构定义
Trie 树中每个节点包含了 26 个指针,但有很大一部分的指针是 NULL 指针,因此浪费了大量的资源。
一种改进措施就是,以一棵树来代替上述的指针数组。...
分类:
其他好文 时间:
2014-05-01 17:49:30
阅读次数:
326
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
我采用Database First,用Sql很容易就可以做到对一个表进行压缩。如以下:
CREATE TABLE [dbo].[Entities](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](max) NULL,
Primary Key Clustered ([Id] ASC) WITH (DATA_...
分类:
数据库 时间:
2014-04-30 22:23:39
阅读次数:
436