Question: 2.1 Given an unsorted std::vector and a number n, what is the worst-case time complexityfor finding the pair of integers whose sum is closest to
2.1 Given an unsorted std::vector and a number n, what is the worst-case time complexityfor finding the pair of integers whose sum is closest to n, using no additional memory? Forexample, given the vector {12, 3, 17, 5, 7} and n = 13, we would get the pair {5, 7}.A.(log n)B.(n)C.(n log n)D.(n2)E.(2n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
