I have a list of strings which are Guids. I want to return them in sorted order in a api and I want to return 1000 Guids at a time. So, I may have a list of 20000 guids and I want to return them in sorted manner 1000 Guids at a time. I thought of using PriorityQueue and get first 1000 elements. How shall I get next page size from PriorityQueue (from 1000 to 2000, from 2000 to 3000).
The reason I want to use priority queue is because I want it to be performant. I don't want to sort using simple list and take n elements based on page number.
Also, I want to get any suggestion, if someone has any other data structure in getting list of subscriptionIds in sorted manner by pages.