
cc150
文章平均质量分 50
hyperbolechi
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
cracking the code interview convert array to BST Python
Given a sorted array with unique interger elements write an algorithm to create a binary search tree with minimal heightarr=[10,9,8,7,6,5,4,3,2,1]we recursively build the tree based on the a原创 2015-01-20 23:43:07 · 580 阅读 · 0 评论 -
craking the code interview all path sum python
Problem:You are given a binary tree in which each node contains a value. Design an algorithm to print all paths which sum to a given value. The path does not need to start or end at the root or a le原创 2015-01-21 06:20:55 · 1210 阅读 · 0 评论 -
cracking the code interview balanced tree python
Implement a function to check if a binary tree is balanced.Solution:We need to define two functions one to check the depth of nodes, another need to compare the depth.Firstly, we build the test原创 2015-01-20 22:28:40 · 625 阅读 · 0 评论 -
cracking the code interview LCA Python
Given two node, find the lowest common ancestor.based on the problem description there are two possible solutions:def covers(root,val): if root==None: return False if root.val==v原创 2015-01-21 02:10:27 · 648 阅读 · 0 评论