Fast algorithm to find the n1 th smallest number to n2 th smallest number in an array
Since, the N1 and N2 are really small compared to size of array  letus  say N.
We can have an implementation in O(N2 * LogN) using min heap data structures.
Steps

Construct a min heap. Complexity of this operation will be O(N)
Loop for a range of 0 to N2:
     Get the root element and call heapify. Ignore first N1 elements and return rest of the elements. Complexity of this step is O(1)+O(logN)
Hence, overall we have O(N2 * logN)
I have an array, I attempt to find the n1 th smallest number until the n2 th smallest number in the array and store them in another array of size n2-n1+1. Here n2>n1 and both are realtively small compared to the size of the array (for example, the array size is 10000, n1=5, n2=20). 
I can sort this array first, and then retrieve the n1 th number, n1+1 th number until the n2 th number from the sorted array. But since n1 and n2 are usually relatively small compared to the size of the array, it is not necessary to sort the array completely. The algorithm should be able to stop in middle once reaches n2 I think. 
I wonder if there is any algorithm, maybe a modified version of certian sorting algorithm that is specifacally good (by good I mean fast) at this problem. You can either use Python code or pseudo code as an illustration, thanks!