// can hold all numbers. // Cheating! // Do we know the max or min? // Consider using bitmap // If 1 billion numbers also spread a lot. // 1. Hash-split into K smaller pieces. Just % n. Thinking about how to handle negative numbers. // Dealing with the small files. // Maintain a min heap with 1 million. (so said) // Random select K as pivok. // Track numbers bigger than K. // If # > 1m, pivot right, to find 1m // else, pivot left, (1m - #)
时间: 2024-12-17 02:21:04