摘要: One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B , we say that A and B is r 阅读全文
posted @ 2020-03-11 22:52 阳离子 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 非线性时间比较类 1. 交换排序 1.冒泡排序 思想:从前往后扫描,如果相邻两个元素的大小不满足要求,则进行交换。因此,每一轮可以将最大的元素放到最后一位,下一轮扫描时,就无需进行到最后一位了。 时间复杂度:进行两重循环,因此是O(n^2) 空间复杂度:原地排序,无需其他额外的空间,因此是O(1) 阅读全文
posted @ 2020-03-11 14:40 阳离子 阅读(276) 评论(0) 推荐(0) 编辑