第一步: 1 /** 2 * 获取所有的Activtiy 3 * 4 * @return 5 */ 6 public static SparseArray getCompanyPackageName() { 7 String ...
分类:
移动开发 时间:
2015-08-06 18:10:15
阅读次数:
158
分层遍历二叉树的集中情况 ? 从上而下的打印 vector<vector<int>>?printLevel(TreeNode?*root)
{
????
????vector<vector<int>>??ret;
????if(root?==?NULL)?return?ret;
????
????...
分类:
编程语言 时间:
2015-08-06 17:04:41
阅读次数:
244
Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique ...
分类:
其他好文 时间:
2015-08-06 16:51:34
阅读次数:
109
1. 饿汉模式:
#include
using namespace std;
class Singleton {
public:
static Singleton& getInst (void) {
return s_inst;
}
private:
Singleton (void) {}
Singleton (const Singleton&);
static Single...
分类:
其他好文 时间:
2015-08-06 16:46:19
阅读次数:
116
<?php/** * 从来没有产生一个唯一的激活码 * @return string */function create_guid($namespace = null) { static $guid = ''; $uid = uniqid ( "", true ); $data = $namesp....
分类:
Web程序 时间:
2015-08-06 16:26:16
阅读次数:
364
function getType(o) {
var _t;
return ((_t = typeof(o)) == "object" ? Object.prototype.toString.call(o).slice(8,-1):_t).toLowerCase();
}...
分类:
Web程序 时间:
2015-08-06 15:21:17
阅读次数:
140
/**
* 功能:交换某个整数的奇数位和偶数位,使用指令越少越好(即,位0与位1交换,位2与位3交换,以此列推)。
*/
/**
* 思路:先操作奇数位,再操作偶数位。将数字n的奇数位右移1位,偶数位左移1位。
* @param x
* @return
*/
public static int swapOddEvenBits(int x){
//奇数位右移...
分类:
其他好文 时间:
2015-08-06 15:09:04
阅读次数:
112
Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return...
分类:
其他好文 时间:
2015-08-06 15:08:56
阅读次数:
86
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and co...
分类:
其他好文 时间:
2015-08-06 13:24:04
阅读次数:
85
import java.util.ArrayList;
import java.util.List;
/**
* 围成圈,排队报数,求最后一人
* @author fjza1168
*
*/
public class Qlastpeople {
/**
*
* @param list 人员列表
* @param num 每num人,出列一人
* @return
...
分类:
编程语言 时间:
2015-08-06 13:19:56
阅读次数:
132