摘要: Implement a function to check if a binary tree is a binary search tree. 这道题很经典,让我们判断一棵树是不是二叉查找树。但是首先要确定一下二叉查找树的定义,比如leetcode 98题中的定义左<根<右就可以直接通过判断中序遍历 阅读全文
posted @ 2018-06-16 05:26 infinitycoder 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Implement a function to check if a binary tree is balanced. For the purpose of this question, a balanced tree is defined to be a tree such that the he 阅读全文
posted @ 2018-06-16 00:50 infinitycoder 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, design an algorithm which creates a linked list of all the nodes at each depth.(e.g., if you have a tree with depth D, you'll hav 阅读全文
posted @ 2018-06-16 00:06 infinitycoder 阅读(257) 评论(0) 推荐(0) 编辑