Write an algorithm that searches the array for two integers


Problem

Suppose you are given an integer array A of length n and some integer z. Write an algorithm that searches the array for two integers x and y such that x + y = z. The algorithm should return the pair (x, y) if it finds that and some reserved token "NONE" if two such integers do not exist. Your algorithm must run in O(n) time and O(n) space.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Write an algorithm that searches the array for two integers
Reference No:- TGS03255952

Expected delivery within 24 Hours