2014年4月16日

[线索二叉树] [LeetCode] 不需要栈或者别的辅助空间,完成二叉树的中序遍历。题:Recover Binary Search Tree,Binary Tree Inorder Traversal

摘要: 既上篇关于二叉搜索树的文章后,这篇文章介绍一种针对二叉树的新的中序遍历方式,它的特点是不需要递归或者使用栈,而是纯粹使用循环的方式,完成中序遍历。线索二叉树介绍首先我们引入“线索二叉树”的概念:"A binary tree isthreadedby making all right child po... 阅读全文

posted @ 2014-04-16 01:05 Felix Fang 阅读(1314) 评论(0) 推荐(0) 编辑

二叉树系列 - 二叉搜索树 - [LeetCode] 中序遍历中利用 pre节点避免额外空间。题:Recover Binary Search Tree,Validate Binary Search Tree

摘要: 二叉搜索树是常用的概念,它的定义如下:The left subtree of a node contains only nodes with keysless thanthe node's key.The right subtree of a node contains only nodes wit... 阅读全文

posted @ 2014-04-16 00:39 Felix Fang 阅读(1527) 评论(0) 推荐(0) 编辑

导航