Question: We are given an array that contains N numbers. We want to determine if the are the numbers whose sum equals a given number K
We are given an array that contains N numbers. We want to determine if the are the numbers whose sum equals a given number K For instance, if the input is B ant Kis then the answer is yes and A number may be used hwice.
Select one or more.
O a If the elements are fist sorted with quicksor, then the total cast of the sohn
algorithm is ON log N
b I the elements are first sorted with heapsor, then the total cost af the soling algorithm is ON log N
O If the elements are already presorted then the cost of the seact algarithm is O DId. A bruteforce search algoritim costs ON
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
