Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].class Sol...
分类:
其他好文 时间:
2015-07-12 15:35:54
阅读次数:
100
1. 二分查找//递归版int binarySearch(const int arr[], int low, int high, int val){ if (low arr[mid]) return binarySearch(arr, mid+1, high, val)...
分类:
编程语言 时间:
2015-07-12 15:31:36
阅读次数:
222
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.public class Solution { public Lis...
分类:
其他好文 时间:
2015-07-12 15:26:42
阅读次数:
116
1.jquery.extend(object); 为扩展jQuery类本身.为类添加新的方法。jquery.fn.extend(object);给jQuery对象添加方法。$.extend({ add:function(a,b){return a+b;} }); //$.add(3,4);//r.....
分类:
Web程序 时间:
2015-07-12 14:03:46
阅读次数:
118
#include
using namespace std;
//产生任意范围的随机数。
int Grial(int i,int j )
{
int x = 0;
while (!(x>=i && x<j))
{
x = rand() % j;
}
return x;
}
int main()
{
cout <<...
分类:
编程语言 时间:
2015-07-12 12:48:22
阅读次数:
136
var a = (function(){ var c= 0; return function(){ return ++c; } }()); var g = a(); console.log(g); var e= a(); console.log(e); var f = a(); cons...
分类:
其他好文 时间:
2015-07-12 12:44:09
阅读次数:
73
题目:用C++设计一个不能被继承的类。
class SealedClass1
{
public:
static SealedClass1* GetInstance()
{
return new SealedClass1();
}
static void DeleteInstance(SealedClass1* pInstance)
{
delete pInstance;...
分类:
其他好文 时间:
2015-07-12 11:22:11
阅读次数:
177
class Solution {
public:
bool searchMatrix(vector>& matrix, int target) {
if(matrix.size() == 0)
return false;
bool result = false;
int row = 0, col = matrix[0]...
分类:
其他好文 时间:
2015-07-12 11:18:39
阅读次数:
98
微信摇一摇功能大家想必用过~ ios SDK帮我们完成了所有功作,我们只需要添加相应的逻辑即可
下面贴出实现代码(在对应的ViewController中添加如下代码):
#pragma mark - motion refresh
- (BOOL)canBecomeFirstResponder {
return YES;
}
- (void)motionBegan:(UIEve...
分类:
微信 时间:
2015-07-12 11:11:13
阅读次数:
239
Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ord...
分类:
其他好文 时间:
2015-07-12 11:10:36
阅读次数:
83