Question: COURSE: DESIGN AND ANALYSIS OF ALGORITHM Instructions: You can use any programming language or tool to work on this Project. Q1. (5%) a) Design and

 COURSE: DESIGN AND ANALYSIS OF ALGORITHM Instructions: You can use any

COURSE: DESIGN AND ANALYSIS OF ALGORITHM

Instructions: You can use any programming language or tool to work on this Project. Q1. (5%) a) Design and implement an Algorithm for the following problem: "Given an array A consisting of n integers, and an integer b, find out if there exist two elements cand din A, such that c + d = b." I. A might contain positive or negative numbers, or zero. ii. A might contain duplicate values. iii. You also need to output each pair of elements (c,d) out of possibly multiple ones, if any exists. b) Your Algorithm should not run in more than (n logn) time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!