正文内容加载中...
posted @ 2015-05-02 11:24 2020_xx 阅读(649) 评论(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 阅读(181) 评论(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 阅读(264) 评论(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 阅读(286) 评论(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 阅读(303) 评论(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 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目:设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为n*xn-1。)输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多... 阅读全文
posted @ 2015-04-04 17:56 2020_xx 阅读(1977) 评论(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 阅读(182) 评论(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 阅读(125) 评论(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 阅读(172) 评论(0) 推荐(0) 编辑