Face-to-face answer

Article Directory

Algorithm question

  1. Find the top 100 largest from 100 million
  1. 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)
  2. Heap row, maintain 100 numbers, time complexity O (nlogk = 1 billion * log100)
  3. Partial elimination method (no sorting), maintaining the top 100 variables. Time complexity O(nlogn = 1 billion * 100)

Puzzle

  1. 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

Guess you like

Origin blog.csdn.net/weixin_43154149/article/details/113861467