c# - Simultaneous Sorting/Removing data from a List -
currently have list of integers. list contains index values point "active" objects in another, larger list. if smaller list of "active" values becomes large, triggers loop iterates through small list , removes values have become inactive. currently, removes them ignoring inactive values , adding them second list (and when second list gets full again same process repeated, placing them first list , on). after trigger occurs, list sorted using quicksort implementation. fine , dandy. -------question--------- however, see potential gain of speed. imagining combining removal of inactive values while sorting taking place. unfortunately, cannot find way implement quicksort in way. because quicksort works pivots, means if values removed list, pivot try access slot in list not exist, etc etc.. (unless i'm thinking wrong). so, ideas on how combine 2 operations? can't seem find sorting algorithms fast quicksort handle this, or perhaps i'm not seeing ho...