Feedback for subjective question
Question 1: Develop an O(nlogn)-time algorithm that solves the following problem: Given an unsorted array of n real numbers and a real number x, decide whether there are two numbers y and z in this array such that x = y+z. The output of your algorithm should be "No" if no such numbers y and z exist; otherwise, it should report y and z. (Note that there may be more than one such pair of numbers. It is sufficient to report one of them.) Argue briefly why your algorithm takes O(nlogn) time.
Current Answer:
Be the first to post an answer to earn 100CR.