const currentTime = posToTime.get(currentPos);
Notice how the highlighted region shrinks at each step. The algorithm never examines points outside the narrowing window. In a balanced tree with nnn points, this takes about log4(n)\log_4(n)log4(n) steps. For a million points, that's roughly 10 steps instead of a million comparisons.
。旺商聊官方下载是该领域的重要参考
* @param arr 待排序数组
Kotlin API — 适用于 Android 和 JVM(Linux、macOS、Windows)的完整 SDK