Article Directory
Algorithm question
- Find the top 100 largest from 100 million
- Divide-and-conquer method (Quick sorting template, find the 100th largest for each copy, and merge at the end, suitable for the case of insufficient memory), time complexity O (nlogn = 1 billion * 100)
- Heap row, maintain 100 numbers, time complexity O (nlogk = 1 billion * log100)
- Partial elimination method (no sorting), maintaining the top 100 variables. Time complexity O(nlogn = 1 billion * 100)
- If the repetition rate is high, first use the hash to de-duplicate the
reference material-Mass data processing-Find the largest 10,000 number out of a billion (top K problem)
Puzzle
- Horse racing problem
64 horses, 8 tracks, find the 4 fastest horses (detailed interview questions) (Answer: 11 rounds = 8 + 1 + 2)
100 horses, 4 tracks, find the fastest Of 4 horses