Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.难度:60.这是算法中比较经典的问题,判断一个字...
分类:
其他好文 时间:
2014-09-20 14:02:47
阅读次数:
292
[leetcode]Implement pow(x, n)....
分类:
其他好文 时间:
2014-09-20 10:04:17
阅读次数:
110
原题地址:https://oj.leetcode.com/problems/next-permutation/题意:Implement next permutation, which rearranges numbers into the lexicographically next greater...
分类:
编程语言 时间:
2014-09-20 07:44:56
阅读次数:
241
BFS (Bridth First Search) can be implemented by a queue.Procedure is like this: (Q is Queue)1, Put 1 in Q : ->1 (front) 2, Read the front of Q (which ...
分类:
其他好文 时间:
2014-09-20 04:36:36
阅读次数:
237
Implement pow(x, n).Analysis:The most basic idea, x multiply itself n time and return. However, this strait forward approach got time excessed. O(n).N...
分类:
其他好文 时间:
2014-09-20 01:04:26
阅读次数:
207
http://zeromq.orgZeroMQ\zero-em-queue\, \ØMQ\:?Ø Connect your code in any language, on any platform.?Ø Carries messages across inproc, IPC, TCP, TPI.....
分类:
其他好文 时间:
2014-09-19 22:23:46
阅读次数:
190
http://rdoc.info/github/ruby-amqp/bunny/Bunny/QueueClass: Bunny::QueueInherits:Object show all Defined in:lib/bunny/queue.rbOverviewRepresents AMQP 0....
分类:
其他好文 时间:
2014-09-19 19:12:45
阅读次数:
455
Implement int sqrt(int x).难度:76,用二分查找。要求是知道结果的范围,取定左界和右界,然后每次砍掉不满足条件的一半,知道左界和右界相遇。算法的时间复杂度是O(logx),空间复杂度是O(1)。 1 public class Solution { 2 public ...
分类:
其他好文 时间:
2014-09-19 13:45:15
阅读次数:
122
1.Implement a functionthat prints the numbers from 1 to 100.But for multiples of three(3) print “Zif”insteadof the number and for the multiples of five(5) print “Nab”. For numbers whichare multiples...
分类:
编程语言 时间:
2014-09-19 12:06:25
阅读次数:
198
本来想用 priority_queue 去写个bfs。结果重载运算符忘了。ORZ。
然后看书和问别人熟悉了一下,记录一下。
struct lx
{
int x,y,lv;
};
有一个这样的结构体。x,y,是坐标,lv 是它的权。重载
struct lx
{
int x,y,lv;
friend bool operator<(lx a,lx b)
...
分类:
编程语言 时间:
2014-09-19 12:01:05
阅读次数:
236