package com.test.sale;
import java.util.ArrayList;
import java.util.List;
public class swapPro
{
public static void main(String[] args)
{
int[] emp1 = { 2, 4, 5, 6 };
int[] emp2 = { 4, 6, 3, 56, 67, 88 };
int k = 0, temp1;
for ( int i = 0; i < emp1.length - 1; i++)
{
for ( int j = 0; j < emp1.length - 1 - i; j++)
{
if ( emp1[j] < emp1[j + 1] )
{
temp1 = emp1[j];
emp1[j] = emp1[j + 1];
emp1[j + 1] = temp1;
}
}
}
for ( int i = 0; i < emp2.length - 1; i++)
{
for ( int j = 0; j < emp2.length - 1 - i; j++)
{
if ( emp2[j] < emp2[j + 1] )
{
temp1 = emp2[j];
emp2[j] = emp2[j + 1];
emp2[j + 1] = temp1;
}
}
}
for ( int i = 0; i < emp2.length; i++)
{
System.out.println(emp2[i]);
}
for ( int i = 0; i < emp1.length; i++)
{
System.out.println(emp1[i]);
}
List empList = new ArrayList();
int first = 0;
int second = 0;
for ( int i = 0; first < emp1.length && second < emp2.length; i++)
{
if ( emp1[first] == emp2[second] )
{
empList.add(emp1[first]);
first++;
second++;
}
else if ( emp1[first] < emp2[second] )
{
empList.add(emp2[second]);
second++;
}
else
{
empList.add(emp1[first]);
first++;
}
}
for ( int i = first; i < emp1.length; i++)
{
empList.add(emp1[i]);
i++;
}
for ( int i = second; i < emp2.length; i++)
{
empList.add(emp2[i]);
i++;
}
System.out.println("Jayaprakash");
}
}