摘要: (referrence: ProgramCreek)The key to solve inorder traversal of binary tree includes the following:The order of "inorder" is: left child -> parent -> ... 阅读全文
posted @ 2015-09-29 08:43 树獭君 阅读(220) 评论(0) 推荐(0)
摘要: QuestionThere are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have... 阅读全文
posted @ 2015-09-29 07:19 树獭君 阅读(243) 评论(0) 推荐(0)
摘要: Topological sorting/ ordering is a linear ordering of itsverticessuch that for every directed edgeuvfrom vertexuto vertexv,ucomes beforevin the orderi... 阅读全文
posted @ 2015-09-28 23:05 树獭君 阅读(561) 评论(0) 推荐(0)
摘要: Question 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 f 阅读全文
posted @ 2015-09-24 10:17 树獭君 阅读(130) 评论(0) 推荐(0)
摘要: QuestionClone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labe... 阅读全文
posted @ 2015-09-24 10:07 树獭君 阅读(197) 评论(0) 推荐(0)
摘要: Reference: superWhen we override superclass's methods, but still want to invoke them, we can use keyword super in child classes.We can also usesuperto... 阅读全文
posted @ 2015-09-24 08:38 树獭君 阅读(179) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next leve... 阅读全文
posted @ 2015-09-24 07:04 树獭君 阅读(174) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the ne... 阅读全文
posted @ 2015-09-24 05:39 树獭君 阅读(153) 评论(0) 推荐(0)
摘要: QuestionGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root)... 阅读全文
posted @ 2015-09-24 04:58 树獭君 阅读(174) 评论(0) 推荐(0)
摘要: Question Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binar 阅读全文
posted @ 2015-09-24 04:47 树獭君 阅读(194) 评论(0) 推荐(0)