摘要: A sequence S = {s1, s2, ..., sn} is called heapable if there exists a binary tree T with n nodes such that every node is labelled with exactly one ele 阅读全文
posted @ 2017-04-25 21:47 gongpixin 阅读(862) 评论(0) 推荐(0) 编辑
摘要: 二分查找 二分查找变形 随着二分查找的进行,如果找到key并不结束循环的话,最终的结束状态会是right < left,并且right + 1 = left。 当数组中存在key时,根据二分区间选择的不同,这里又分为两种情况,如下图(key为2时), 当数组中不存在key时,最后仅有一种情况,即把图 阅读全文
posted @ 2017-04-25 12:28 gongpixin 阅读(13247) 评论(14) 推荐(7) 编辑