Question: 1. (a) 5 marks] Describe an O(n log n) algorithm (in the sense of the worst case performance) that, given an array S of n
1. (a) 5 marks] Describe an O(n log n) algorithm (in the sense of the worst case performance) that, given an array S of n integers and another integer r, determines whether or not there exist two elements in S whose sum is exactly z. (5 pts) (b) [5 marks] Describe an algorithm that accomplishes the same task, but runs in O(n) expected (average) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
