上一页 1 2 3 4 5 6 7 ··· 25 下一页
摘要: Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test 阅读全文
posted @ 2018-08-27 22:01 赖兴宇 阅读(124) 评论(0) 推荐(0) 编辑
摘要: The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i 阅读全文
posted @ 2018-08-27 09:52 赖兴宇 阅读(138) 评论(0) 推荐(0) 编辑
摘要: There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either 阅读全文
posted @ 2018-08-27 00:24 赖兴宇 阅读(349) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2018-08-26 23:01 赖兴宇 阅读(224) 评论(0) 推荐(0) 编辑
摘要: The following is from Max Howell @twitter: Now it's your turn to prove that YOU CAN invert a binary tree! Input Specification: Each input file contain 阅读全文
posted @ 2018-08-26 22:24 赖兴宇 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 结构体自定义运算符 STL的使用 一. 二叉树相关: 前序, 中序, 后序, 层序遍历结果,分别用pre, in, post ,level表示的数组来记录 001.1020 Tree Traversals (25) https://www.cnblogs.com/mr-stn/p/9214298.h 阅读全文
posted @ 2018-08-26 18:41 赖兴宇 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 由getline的定义可以知道, getline返回的是一个输入流, 正常情况下输入流都是正确的, 因而 是一个死循环无法跳出; Get line from stream into string Extracts characters from is and stores them into str 阅读全文
posted @ 2018-08-24 08:11 赖兴宇 阅读(4778) 评论(0) 推荐(0) 编辑
摘要: The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. F 阅读全文
posted @ 2018-07-24 22:37 赖兴宇 阅读(137) 评论(0) 推荐(0) 编辑
摘要: A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years 阅读全文
posted @ 2018-07-24 16:30 赖兴宇 阅读(151) 评论(0) 推荐(0) 编辑
摘要: According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. At each iteration, ins 阅读全文
posted @ 2018-07-14 00:03 赖兴宇 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 25 下一页