Question: Soukaina Fali Boubrahimi CSc 2720- Data Structures: Lab 7 Given an array of unique positive integers, write a function findSurns that takes the array input

Soukaina Fali Boubrahimi CSc 2720- Data Structures: Lab 7 Given an array of unique positive integers, write a function findSurns that takes the array input and 1. Creates a hashtable called "hashT and inserts all the elements of the input array in the hashtable. 2. Finds pairs of clements in the hashtable whose sum is anather element (sum) in the hashtable and print the pairs in the console. 3. Returns anather hashtable names "sums af those sum elements For example: Input: [1,5,4,6,7,9 output: t6,5,7,91 Explanation: 6-1+5; 5-147-16;9-54 Class Tenplate irport java.util.HashSet public class FindSun t public static void nain(String args [] arr 1, 5, 4, 6, 7, 9 ) HashSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
