Binary search has the advantages of fast search speed and good average performance, but only when the list is **ordered**, binary search works. It is often tested in interviews. This article will explain the binary search algorithm.
Since the recommendation algorithm I use is based on collaborative filtering, let's talk about collaborative filtering algorithms.
What is the TopK algorithm? To put it simply, it is to find the first K largest (of course, it can also be the first K smallest) number in a bunch of data.