added find k smallest element algorithm