In the previous post I have discussed a typical case in which the use of a heap structure is very useful, presenting some code that allows to build and manage a heap structure on-top of a vector.
To complete the discussion this time I’m posting the C# code that implements a “clean” heap data structure. Continue reading
I this thread I will discuss about making order in our life… well… at least in a long vector of objects… OK, just a small part of that vector.
This is a fundamental aspect of search engines: you are interested in getting only the k most relevant results, whatever the size of the collection you are searching on is.
The k value is usually very small with respect to the collection size, e.g. on the Web one is likely to look at just the first ten-twenty results. Search engines typically set a z value of maximum returned results that is designed to be larger than the largest part of possible k values, e.g. Google returns at most one thousand results.