Chapter 9 | Sorting and Searching
插入排序,需要调整数组,移位。如果链表好做得多。
9.2 Write a method to sort an array of strings so that all the anagrams are next to each other.
先排一次词本身,再排词之间。
如原解
字典树,自然有序。。红黑树也行。
转换为字典求解。
9.6 Given a matrix in which each row and each column is sorted, write a method to find an element in it.
排除法
背包?
本文探讨了多种排序与搜索算法的应用场景及实现方法,包括数组合并、字符串排序、旋转数组查找、大型文件排序等,并讨论了矩阵元素查找及特定条件下的最长序列构建等问题。
6389

被折叠的 条评论
为什么被折叠?



