摘要: 中序遍历(左中右)普通树有两种遍历方式: 深度优先遍历。 先根遍历 –> 二叉树中的先序遍历(中左右) 后根遍历 –> 二叉树中的后序遍历(左右中) 作为树的特例,二叉树还有一种特殊的遍历方式:中序遍历(左中右) 宽度优先遍历。 二叉树的三种遍历方式: 先序遍历(中左右) 中序遍历(左中右) 后序遍历(左右中) 阅读全文
posted @ 2015-02-10 11:43 程序员小王 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 题目分析: 题目中没有说清楚的一点是,假如中间的数... 阅读全文
posted @ 2015-02-10 11:06 程序员小王 阅读(103) 评论(0) 推荐(0) 编辑