MinHeap implementation for .NET

A heap is a balanced tree which has some special properties. There are two variations of heap: MinHeap and MaxHeap. MinHeap has the property where the parent node is lesser than all the child nodes. In a MinHeap, the root node has the minimum value. MaxHeap is the opposite of MinHeap. MaxHeap has the maximum value in the root node.[…]

Read more

Getting all documents from a FAST collection

The Introduction to FAST Search API provides an introduction on how to use the FAST API. The following code explains how to get all documents from a FAST collection.

When a search query is sent to FAST, FAST prepares a result set with a maximum of 4020 documents. By passing in two query parameters: offset and hits, it is possible[…]

Read more

QuickSelect works in linear time

QuickSelect is a selection algorithm that finds the kth┬ásmallest number from a list. QuickSelect is O(n) algorithm. I built a simple prototype to verify that QuickSelect works in linear time. QuickSelect uses a random pivot to partition the array. The items to the left of the pivot are lesser than the pivot. The items to the right of the pivot[…]

Read more