测速代码: <?php function getmicrotime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime( ...
分类:
Web程序 时间:
2018-04-10 13:31:25
阅读次数:
231
一、题目 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 b ...
分类:
其他好文 时间:
2018-04-10 10:53:42
阅读次数:
184
使用栈来实现队列的如下操作: push(x) -- 将一个元素放入队列的尾部。pop() -- 从队列首部移除元素。peek() -- 返回队列首部的元素。empty() -- 返回队列是否为空。注意: 你只能使用标准的栈操作-- 也就是只有push to top, peek/pop from to ...
分类:
其他好文 时间:
2018-04-09 13:05:39
阅读次数:
149
实现一个 Trie (前缀树),包含 insert, search, 和 startsWith 这三个方法。注意:你可以假设所有的输入都是小写字母 a-z。详见:https://leetcode.com/problems/implement-trie-prefix-tree/description/ ...
分类:
其他好文 时间:
2018-04-08 19:43:48
阅读次数:
117
【题目描述】 Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node. 给定一个单链表中的一个等待被删除的节点(非表头或表尾)。请在在O ...
分类:
其他好文 时间:
2018-04-07 11:22:23
阅读次数:
146
接口接口:如果一个类只是由抽象方法和全局常量组成,这种情况不会定义为一个抽象类,而是将其定义为接口.同时接口打破了抽象类子类的一个很大的问题 单继承局限.在java中,可以使用interface来定义.如: 接口也必须有子类,一个子类可以使用implement关键字实现多个接口,避免单继承的局限.接 ...
分类:
其他好文 时间:
2018-04-06 13:59:22
阅读次数:
163
原题链接: "https://leetcode.com/problems/implement queue using stacks/description/" 实现如下: ...
分类:
其他好文 时间:
2018-04-06 12:25:32
阅读次数:
165
题目描述: Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example 1: Example 2: 要实现的函数: ...
分类:
其他好文 时间:
2018-04-05 11:50:09
阅读次数:
189
题目描述: Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. 思路:二分查找,时间复杂度O(logn)。 if(mid的平 ...
分类:
其他好文 时间:
2018-04-01 12:00:02
阅读次数:
141
Implement an iterative, in-order traversal of a given binary tree, return the list of keys of each node in the tree as it is in-order traversed. Examp ...
分类:
其他好文 时间:
2018-03-31 00:40:42
阅读次数:
176