Guru: Searching Teraspace
March 5, 2018 Jon Paris
In my previous tip, Sorting In Teraspace, I looked at how the qsort API can be used to sequence data in ways that SortA can’t begin to approach. Now that the data is sorted, one of the things I may want to do with it is to search it. In this tip I will look at how that can be achieved using the bsearch API. The approach I will be discussing allows for partial key searches and handling the fact that such a search may result in multiple hits.
As you will see when we work through the code, …
Read more