摘要: “六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图6.4所示。图6.4 六度空间示意图“六度空间”理论虽然得到广泛的认同,并... 阅读全文
posted @ 2015-05-02 11:24 2020_xx 阅读(687) 评论(0) 推荐(1) 编辑
摘要: 题目:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with ... 阅读全文
posted @ 2015-04-12 15:35 2020_xx 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目:Insert a sequence of given numbers into an initially empty min-heap H. Then for any given index i, you are supposed to print the path from H[i] to ... 阅读全文
posted @ 2015-04-06 13:08 2020_xx 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题目:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at ... 阅读全文
posted @ 2015-04-06 10:55 2020_xx 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one ... 阅读全文
posted @ 2015-04-05 19:02 2020_xx 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5... 阅读全文
posted @ 2015-04-05 11:09 2020_xx 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目:设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为n*xn-1。)输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多... 阅读全文
posted @ 2015-04-04 17:56 2020_xx 阅读(1993) 评论(0) 推荐(0) 编辑
摘要: // Playground - noun: a place where people can playimport UIKit// 几个重要的概念Properties/Methods/Subscripts/Initialization/Extensions/Protocols/Inheritance... 阅读全文
posted @ 2014-11-23 18:30 2020_xx 阅读(197) 评论(0) 推荐(0) 编辑
摘要: // Playground - noun: a place where people can playimport UIKit// 枚举语法enum SomeEnumeration { // enumeration definition goes here}// 定义一个枚举enum Comp... 阅读全文
posted @ 2014-11-23 18:29 2020_xx 阅读(127) 评论(0) 推荐(0) 编辑
摘要: // Playground - noun: a place where people can playimport UIKit// swift 中闭包与C和OC中的blocks比较相似// 1. 利用上下文推断参数和返回值类型 2. 单表达式闭包可以省略return关键字 3. 参数名称简写 4. ... 阅读全文
posted @ 2014-11-23 18:28 2020_xx 阅读(184) 评论(0) 推荐(0) 编辑