Skip to content

Commit a23a17b

Browse files
authored
Update Intersection
1 parent ec4f6a1 commit a23a17b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

DataStructures/HashMap/Hashing/Intersection

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
package DataStructures.HashMap.Hashing;
2+
/*
3+
* this is algo which implies common mathematical set theory concept
4+
* called intersection in which result is common values of both the sets
5+
* here metaphor of sets is HashMap
6+
7+
8+
Test Case:
9+
Scanner scn=new Scanner(System.in);
10+
int len =scn.nextInt();
11+
int arr[]=new int[len];
12+
int arr2[]=new int[len];
13+
14+
for(int i=0;i<2*len;i++) {
15+
16+
if(i<len)
17+
arr[i]=scn.nextInt();
18+
if(i>=len) {
19+
arr2[i-len]=scn.nextInt();
20+
}
21+
}
22+
System.out.println(Main(arr,arr2));
23+
24+
25+
26+
*/
27+
128
import java.util.ArrayList;
229
import java.util.HashMap;
330
import java.util.Map;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy