partial-sort Questions

3

Solved

I'm trying to implement a paging algorithm for a dataset sortable via many criteria. Unfortunately, while some of those criteria can be implemented at the database level, some must be done at the a...
Parkland asked 13/3, 2013 at 20:5

2

Solved

I need to get the top N items from a Vec which is quite large in production. Currently I do it like this inefficient way: let mut v = vec![6, 4, 3, 7, 2, 1, 5]; v.sort_unstable(); v = v[0..3].to_v...
Lithographer asked 3/12, 2018 at 14:24

2

Solved

Is there a significant difference between the following two approaches? Way 1 uses sort or partial_sort, depending on the size of the vector while way 2 always uses partial_sort. I find way 2 more ...
Koss asked 2/8, 2017 at 8:21
1

© 2022 - 2024 — McMap. All rights reserved.