C++20 sections · 1024 units
Open in CourseQuiz: Practical Application
Knowledge check
Check Your Understanding
You need to find the 3 smallest elements in unsorted vector v. Which approach is most efficient?
- A.Use partial_sort with n=3
- B.Use min_element 3 times
- C.Sort entire vector, take first 3
- D.Use lower_bound 3 times