Answers for "find the union and intersection of the two sorted arrays. in java"

0

find union and intersection of two arrays in java

static void findIntersection(int arry1[],int arry1size,int arry2[],int arry2size){
    	HashSet<Integer> hs=new HashSet<Integer>();
    	for(int i=0;i<arry1size;i++){
    		for(int j=0;j<arry2size;j++){
    			if(arry1[i]==arry2[j]){
    				hs.add(arry1[i]);
    			}
    		}
    	}
    	
    	System.out.println(hs);
    }
Posted by: Guest on September-12-2021

Code answers related to "find the union and intersection of the two sorted arrays. in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language