随笔分类 -  二叉树

摘要:Maximum Depth of Binary Tree Total Accepted: 63668 Total Submissions: 141121 My Submissions Question Solution Given a binary tree, find it... 阅读全文
posted @ 2017-11-17 22:28 wangyaning 阅读(186) 评论(0) 推荐(0)
摘要:大牛没有能做出来的题,我们要好好做一做 Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This prob... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(198) 评论(0) 推荐(0)
摘要:Maximum Depth of Binary Tree Total Accepted: 63668 Total Submissions: 141121 My Submissions Question Solution Given a binary tree, find it... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(127) 评论(0) 推荐(0)
摘要:深度有限遍历记录层数:增加一个level//深度优先遍历void depthFirstSearch(Tree root){ stack > nodeStack; //使用C++的STL标准模板库 nodeStack.push(make_pair(0, root)); Node *... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(463) 评论(0) 推荐(0)
摘要:Balanced Binary Tree Total Accepted: 63288 Total Submissions: 198315 My Submissions Given a binary tree, determine if it is heig... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(160) 评论(0) 推荐(0)
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(129) 评论(0) 推荐(0)
摘要:Symmetric Tree Total Accepted: 61440 Total Submissions: 194643 My Submissions Given a binary tree, check whether it is a mirror... 阅读全文
posted @ 2017-11-17 22:27 wangyaning 阅读(156) 评论(0) 推荐(0)