摘要: 首先,基本问题是这样:You are given two eggs, and access to a 100-storey building. The aim is to find out the highest floor from which an egg will not break when 阅读全文
posted @ 2018-05-15 23:39 CMlhc 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 和并排序和快速排序在元素的重复率特别高的时候排序的时间变长。我们可以利用三向切分的办法来避免相同的元素进行交换,以减少交换次数。 具体如下图所示: 总共有3个指针,lt,i,和gt,这个三个指针分别指着队首,队首的下一位,队尾。以队首为参考点,设该数组为a。设中间变量temp. 阅读全文
posted @ 2018-05-15 18:56 CMlhc 阅读(264) 评论(0) 推荐(0) 编辑