摘要:
方法 时间复杂度 空间复杂度 Stable 冒泡排序(Bubble Sort) O(n) — O(n^2) O(1) yes 选择排序(Selection Sort) O(n^2) — O(n^2) O(1) no 插入排序(Insertion Sort) O(n) — O(n^2) O(1) ye 阅读全文
摘要:
http://www.geeksforgeeks.org/rearrange-a-string-so-that-all-same-characters-become-at-least-d-distance-away/ Given a string and a positive integer d. 阅读全文