Efficient Implementation of range min query / Lowest Common Ancestor Problens