on 03-22-2013 9:31 AM
Hi,
Can anyone please help in the following logic, Where we need to delete unique values of queue and replace with X.
We have incoming structure like
1
2
3
5
1
4
5
output should be like
1
X
X
X
1
X
X
TIA
Hi ,
Please try this:
for (int i = 0 ; i < var1.length; i++)
{
boolean flag = false;
for (int j = 0 ; j< var1.length; j++)
{
if ( (i != j) && (var1[i].equals(var1[j])) )
{ flag= true;
break;
}
}
if (flag == false)
result.addValue("X");
else
result.addValue(var1[i]);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use of if-else..
if <value=1>
value = <pass"1">
else
value = <constant"X">
end
Hope it helps.!
Regards,
Sunil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.