上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 37 下一页
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2018-12-29 05:25 fatttcat 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2018-12-29 05:04 fatttcat 阅读(117) 评论(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 @ 2018-12-29 04:49 fatttcat 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Retu 阅读全文
posted @ 2018-12-28 17:22 fatttcat 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2018-12-28 17:17 fatttcat 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2018-12-28 15:52 fatttcat 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: backtracking, 记得返回上层的时候删掉该层节点 time: O(n) -- visi 阅读全文
posted @ 2018-12-28 15:06 fatttcat 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
posted @ 2018-12-28 13:23 fatttcat 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Invert a binary tree. Example: Input: Output: Trivia:This problem was inspired by this original tweet by Max Howell: time: O(n), space: O(logn) 阅读全文
posted @ 2018-12-28 11:05 fatttcat 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2018-12-28 10:58 fatttcat 阅读(90) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 37 下一页