环境:CentOS5.8,安装了Asterisk 1.8升级php到5.2SugarCRM 6.5: Minimum PHP version required is 5.2.0. You are using PHP version 5.1.6官方的yum源里面没有,如下添加一个额外的源:# rpm ...
分类:
其他好文 时间:
2014-11-11 18:11:46
阅读次数:
369
1.原文问题描述:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -...
分类:
其他好文 时间:
2014-11-11 14:08:11
阅读次数:
168
O(n)的算法就不说了,这题主要考查的是 O(logn)的算法。有序数组容易想到使用二分查找解决,这题就是在二分基础上做一些调整。数组只有一次翻转,可以知道原有序递增数组被分成两部分,这俩部分都是有序递增的(这题只需要考虑有序数组的递增情况)。假如翻转后的数组以第 x 个结点分为两部分 A[0..x] 和 A[x+1..n]。则 A[0..x] 这一段是有序递增的, A[x+1..m] 这一段也是...
分类:
编程语言 时间:
2014-11-11 12:44:02
阅读次数:
261
递归public class Solution {
public int findMin(int[] num) {
return helper(num, 0, num.length-1);
}
//with duplicate
public static int helper(int[] a, int left, int right){
...
分类:
编程语言 时间:
2014-11-11 12:40:09
阅读次数:
211
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:
其他好文 时间:
2014-11-11 07:05:12
阅读次数:
190
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:
其他好文 时间:
2014-11-10 23:13:29
阅读次数:
277
Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -...
分类:
其他好文 时间:
2014-11-10 17:11:24
阅读次数:
174
题意:找到离根结点最近的叶子结点的那一层(设同一层上的结点与根结点的距离相等),返回它所在的层数。方法有:1、递归深度搜索2、层次搜索方法一:递归(无优化) 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * i...
分类:
其他好文 时间:
2014-11-09 22:12:11
阅读次数:
184
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-11-09 13:54:18
阅读次数:
155
Given a very large n-ary tree. Where the root node has some information which it wants to pass to all of its children down to the leaves with the cons...
分类:
其他好文 时间:
2014-11-09 06:13:47
阅读次数:
177