From a23a17ba6540818b266ad56a2fb181512dd4f1b5 Mon Sep 17 00:00:00 2001 From: Ritik2604 <49342895+Ritik2604@users.noreply.github.com> Date: Mon, 25 May 2020 03:22:27 +0530 Subject: [PATCH] Update Intersection --- DataStructures/HashMap/Hashing/Intersection | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/DataStructures/HashMap/Hashing/Intersection b/DataStructures/HashMap/Hashing/Intersection index cfe1f74d7..8b54eeae1 100644 --- a/DataStructures/HashMap/Hashing/Intersection +++ b/DataStructures/HashMap/Hashing/Intersection @@ -1,3 +1,30 @@ +package DataStructures.HashMap.Hashing; +/* +* this is algo which implies common mathematical set theory concept +* called intersection in which result is common values of both the sets +* here metaphor of sets is HashMap + + +Test Case: + Scanner scn=new Scanner(System.in); + int len =scn.nextInt(); + int arr[]=new int[len]; + int arr2[]=new int[len]; + + for(int i=0;i<2*len;i++) { + + if(i=len) { + arr2[i-len]=scn.nextInt(); + } + } + System.out.println(Main(arr,arr2)); + + + +*/ + import java.util.ArrayList; import java.util.HashMap; import java.util.Map;