2014-04-29
01:05题目:数数从0到n总共有多少个数字‘2’?解法:数位动态规划,可以O(log10(n))时间内解决。代码: 1 // 18.4 Count the
number of 2s from 0 to n. 2 #include 3 using namespace std;....
分类:
其他好文 时间:
2014-04-29 14:44:34
阅读次数:
380
2014-04-29
01:02题目:从m个整数里随机选出n个整数,要求等概率。解法:和洗牌的算法类似,每次随机抽出一个数,抽n次即可。时间复杂度O(m *
n),空间复杂度O(m)。代码: 1 // 18.3 pick m integers randomly from an array of n ...
分类:
其他好文 时间:
2014-04-29 14:42:32
阅读次数:
345
jsonutil类 1 package *********** 2 3 import
java.lang.reflect.Field; 4 import java.lang.reflect.Type; 5 import
java.util.ArrayList; 6 import jav...
分类:
Web程序 时间:
2014-04-29 13:41:02
阅读次数:
749
1 package com.szy.status; 2 3 import
android.app.IntentService; 4 import android.app.Notification; 5 import
android.app.NotificationManager; 6 impor.....
分类:
其他好文 时间:
2014-04-29 13:32:48
阅读次数:
549
package com.utils;import
java.beans.Introspector;import java.beans.PropertyDescriptor;import
java.lang.reflect.Field;import java.lang.reflect.Method;i...
分类:
编程语言 时间:
2014-04-29 10:38:46
阅读次数:
472
package com.szy.shared.activity;import
android.app.Activity;import android.content.Context;import
android.content.SharedPreferences;import android.con...
分类:
其他好文 时间:
2014-04-29 10:34:47
阅读次数:
407
利用挖坑填数+分治实现的快排代码如下:import
java.io.BufferedReader;import java.io.IOException;import
java.io.InputStreamReader;import java.util.Formatter;import java.ut...
分类:
其他好文 时间:
2014-04-29 10:33:46
阅读次数:
404
大多数计算机语言,有且仅有一个表示"无"的值,比如,C语言的NULL,Java语言的null,Python语言的None,Ruby语言的nil。有点奇怪的是,JavaScript语言居然有两个表示"无"的值:undefined和null。这是为什么?一、相似性在JavaScript中,将一个变量赋值...
分类:
其他好文 时间:
2014-04-29 10:32:46
阅读次数:
404
Are you worried that you will not be able to
migrate from http://tfs.visualstudio.com when they start charging for it and you
don’t want to pay? Fear ...
分类:
其他好文 时间:
2014-04-29 10:23:47
阅读次数:
496
Extjs加载Store是异步加载的,这有很多好处。但是当我们要在两个或多个不同的store加载完再执行一些操作时,异步加载就成了一个问题。在Stack
Overflow 等网站搜集并试用了几个处理方法,总结如下。1、自己定义一个组件 (From:http://stackoverflow.com/q...
分类:
Web程序 时间:
2014-04-29 09:18:47
阅读次数:
583