What is the fastest way to get all the keys between 2 keys in a SortedList?

前端 未结 3 1918
心在旅途
心在旅途 2021-01-18 11:11

Given a populated SortedList. I would like to get all the keys (or their index range, what should be a closed int interval (mis

3条回答
  •  抹茶落季
    2021-01-18 11:39

    As the list is sorted you can use binary search to locate the endpoints of your interval. Worst case performance will be O(log n).

提交回复
热议问题