Kth minimum in a Range

前端 未结 4 1275
小蘑菇
小蘑菇 2021-01-31 05:35

Given an array of integers and some query operations.
The query operations are of 2 types
1.Update the value of the ith index to x.
2.Given 2 integers find the kth m

4条回答
  •  日久生厌
    2021-01-31 06:00

    perform a modification of the bucket sort: create a bucket that contains the numbers in the range you want and then sort this bucket only and find the kth minimum.

提交回复
热议问题