摘要: 本文参考该作者文章当作编程笔记:作者:Hawstein出处:http://hawstein.com/posts/ctci-solutions-contents.htmlQ:给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。思路:取数组中间元素当作二叉树的根,递归插入。CODE: 1 #include 2 #include 3 #include 4 #define N 6 5 #define key(A) (A) 6 #define less(A,B) (Aend)16 return;17 (*h)=(node *)malloc(sizeof(node));1... 阅读全文
posted @ 2014-03-20 08:51 哈士奇.银桑 阅读(112) 评论(0) 推荐(0) 编辑