- (void)yourButtonTitleTime{ __block int timeout=30; //倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);.....
分类:
其他好文 时间:
2014-06-26 00:43:27
阅读次数:
305
MSMQ(MicroSoft Message Queue,微软消息队列)是在多个不同的应用之间实现相互通信的一种异步传输模式,相互通信的应用可以分布于同一台机器上,也可以分布于相连的网络空间中的任一位置。它的实现原理是:消息的发送者把自己想要发送的信息放入一个容器中(我们称之为Message),然后...
分类:
其他好文 时间:
2014-06-26 00:33:04
阅读次数:
295
题目
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching sh...
分类:
其他好文 时间:
2014-06-25 19:56:35
阅读次数:
275
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using e...
分类:
其他好文 时间:
2014-06-24 23:30:08
阅读次数:
278
题目
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possibl...
分类:
其他好文 时间:
2014-06-24 23:14:28
阅读次数:
238
题目
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key...
分类:
其他好文 时间:
2014-06-24 22:45:43
阅读次数:
202
题目
Implement pow(x, n).
解答
直接用递归法:
//递归法("折半"递归,不要用常规的一个个乘,效率很低)
public class Solution {
public double pow(double x, int n) {
if(n==0)
return 1;
if(n==1)
...
分类:
其他好文 时间:
2014-06-24 21:14:37
阅读次数:
199
heapq模块实现了python中的堆排序,并提供了有关方法。让用Python实现排序算法有了简单快捷的方式。
heapq的官方文档和源码:8.4.heapq-Heap queue algorithm
下面通过举例的方式说明heapq的应用方法
实现堆排序
#! /usr/bin/evn python
#coding:utf-8
from heapq import *
def ...
分类:
编程语言 时间:
2014-06-24 18:47:47
阅读次数:
403
题目
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the ent...
分类:
其他好文 时间:
2014-06-24 18:43:56
阅读次数:
224
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key if ...
分类:
其他好文 时间:
2014-06-24 17:25:41
阅读次数:
197