Question: (a) Design and implement in pseudocode an algorithm that gets as input a list of k integers N1, . . . , Nk as well

(a) Design and implement in pseudocode an algorithm that gets as input a list of k integers N1, . . . , Nk as well as a special value SUM. Your algorithm must locate a pair of values in the list that sum to the value SUM. For example, if your list of values is 3, 8, 13, 2, 17, 18, 10, and the value of SUM is 20, then your algorithm should output either the two values 2 and 18, or the two values 3 and 17. If your algorithm cannot find any pair of values that sum to the value SUM, then it should print out the message sorry, there is no such pair of values.

(b) What is the time complexity of your algorithm in O notation?

-Please use simple psudocode

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!