摘要:
题目: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 ... 阅读全文
摘要:
题目: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 ... 阅读全文
摘要:
题目: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 ... 阅读全文
摘要:
题目: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 ... 阅读全文
摘要:
题目: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... 阅读全文
摘要:
// Playground - noun: a place where people can playimport UIKit// 几个重要的概念Properties/Methods/Subscripts/Initialization/Extensions/Protocols/Inheritance... 阅读全文
摘要:
// Playground - noun: a place where people can playimport UIKit// 枚举语法enum SomeEnumeration { // enumeration definition goes here}// 定义一个枚举enum Comp... 阅读全文
摘要:
// Playground - noun: a place where people can playimport UIKit// swift 中闭包与C和OC中的blocks比较相似// 1. 利用上下文推断参数和返回值类型 2. 单表达式闭包可以省略return关键字 3. 参数名称简写 4. ... 阅读全文