摘要:
一、简介 Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本。这个 Web 框架看起来有些像web.py 或者 Google 的 webapp,不过为了能有效利用非阻塞式服务器环境,这个 Web 框架还包含了一些相关有用工具及优化。 Tornado 阅读全文
摘要:
http://www.lintcode.com/zh-cn/problem/permutation-sequence/# 原题 给定 n 和 k,求123..n组成的排列中的第 k 个排列。 注意事项 1 ≤ n ≤ 9 给定 n 和 k,求123..n组成的排列中的第 k 个排列。 注意事项 1 阅读全文
摘要:
原题 Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 解题思路 递归:递归的方法,创建一个vi 阅读全文
摘要:
原题 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in 阅读全文
摘要:
原题 给定一个含不同整数的集合,返回其所有的子集 如果 S = [1,2,3],有如下的解: 子集中的元素排列必须是非降序的,解集必须不包含重复的子集 解题思路 Backtracking, DFS 数组要排序,接着一层一层的递归,每一层列表的元素个数加一 完整代码 阅读全文
摘要:
http://www.lintcode.com/zh-cn/problem/generate-parentheses/ 原题 给定 n 对括号,请写一个函数以将其生成新的括号组合,并返回所有组合结果。 样例 给定 n = 3, 可生成的组合如下: "((()))", "(()())", "(())( 阅读全文
摘要:
原题 Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 解题思路 代码实现 阅读全文
摘要:
http://www.lintcode.com/zh-cn/problem/sort-integers-ii/ 题目 给一组整数,按照升序排序。使用归并排序,快速排序,堆排序或者任何其他 O(n log n) 的排序算法。 样例 给出 [3, 2, 1, 4, 5], 排序后的结果为 [1, 2, 阅读全文
摘要:
题目 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you hav 阅读全文
摘要:
JavaScript的作用域一直以来是前端开发中比较难以理解的知识点,对于JavaScript的作用域主要记住几句话,走遍天下都不怕... 一、“JavaScript中无块级作用域” 在Java或C#中存在块级作用域,即:大括号也是一个作用域。 public static void main () 阅读全文