stc::list problem #87
-
Hi,How to use the binary search method (lower_bound) in stc:: list? (Thank you very much for your help) |
Beta Was this translation helpful? Give feedback.
Answered by
tylov
Nov 29, 2024
Replies: 1 comment
-
Sorting is supported because it is a "heavy" operation, and it is worth converting the list into an array, quicksort it and put result back into the list. For lower_bound, you should export the list to a vector, sort it and apply lower_bound on that. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tylov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorting is supported because it is a "heavy" operation, and it is worth converting the list into an array, quicksort it and put result back into the list. For lower_bound, you should export the list to a vector, sort it and apply lower_bound on that.