Sparse Table Algorithm

A database index is a data structure that improves the speed of data retrieval operations on a database table at the price of additional writes and storage space to keep the index data structure. index can be created use one or more columns of a database table, supply the basis for both rapid random lookups and efficient access of ordered records.

Sparse Table source code, pseudocode and analysis