working upheap and downheap
find k smallest elements of array using heap
repair main funct