摘要: I'll throw in my two cents here. I believe my code is similar to others' in essence. However, I interpret my method as a simplified version of LEVEL-O... 阅读全文
posted @ 2015-10-24 15:07 曾可爱 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 二叉树的前中后序遍历,可以用递归秒解,看起来不值一提。但如果不允许采用递归,要怎么实现呢?还是先来看看递归算法的实现吧:def visit( root): if root is not null: #1 visit(root.left) ... 阅读全文
posted @ 2015-09-07 19:51 曾可爱 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array A with length m, we can split it into two part:{ A[0], A[1], ... , A[i - 1] } | { A[i], A[i + 1], ... , A[m - 1] }All elements in... 阅读全文
posted @ 2015-09-05 10:15 曾可爱 阅读(173) 评论(0) 推荐(0) 编辑