1. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## need program logic

hi, i am java learner,so i need some programs anyone can able to post here or give some logics

2. ## Re: need program logic

Plenty here: The Really Big Index

3. ## Re: need program logic

Here's another one (A and B are boolean expressions):

!(A || B) == !A && !B

and

!(A && B) == !A || !B

mostly done wrong in situations where you have your brain powered off ...

kind regards,

Jos

4. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

hi to all, is it possible comparing two arrays and remove duplicates and written in a single array

5. ## Re: need program logic

Are you ignoring previous replies by starting just another unrelated question in the same thread?

Jos

6. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

Originally Posted by JosAH
Here's another one (A and B are boolean expressions):

!(A || B) == !A && !B

and

!(A && B) == !A || !B

mostly done wrong in situations where you have your brain powered off ...

kind regards,

Jos
what is this,iam not getting,and im not ignoring

7. ## Re: need program logic

Originally Posted by anonymouss
what is this,iam not getting,and im not ignoring
Those are De Morgan's laws; they are very fundamental laws in Boolean logic and mostly misunderstood.

kind regards,

Jos

8. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

Originally Posted by JosAH
Those are De Morgan's laws; they are very fundamental laws in Boolean logic and mostly misunderstood.

kind regards,

Jos
ok but iam looking for this if we provide two arrays with duplicate values we have to remove duplicate and print the values as a single array

9. ## Re: need program logic

Originally Posted by anonymouss
ok but iam looking for this if we provide two arrays with duplicate values we have to remove duplicate and print the values as a single array
No you were not; you were looking for (and I quote here):

hi, i am java learner,so i need some programs anyone can able to post here or give some logics
and you got two replies and you never gave an answer to them.

Jos

10. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

Originally Posted by PhHein
k thankx but iam not basic learner, i have some doubts which regarding to programs and expecting some program to implement with help of u

Originally Posted by JosAH
No you were not; you were looking for (and I quote here):
why it is not possible ,for example i l say int a[]={5,4,2,1}; and int b[]={5,6,2,8};
the output will be 5,4,6,2,8,1
Last edited by anonymouss; 04-26-2013 at 07:48 AM.

11. ## Re: need program logic

Originally Posted by anonymouss
k thankx but iam not basic learner, i have some doubts which regarding to programs and expecting some program to implement with help of u
why it is not possible ,for example i l say int a[]={5,4,2,1}; and int b[]={5,6,2,8};
the output will be 5,4,6,2,8,1
What code have you got so far? You obviously understand that you came to java-forums.org, not rent-a-coder.com?

12. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

iam not asking to write the program or write the enter code, let me clear int a[]={2,10,15,2 ,8};i want to remove duplicates and writted output as 2,10,15,8,how to remove duplicates if anyone have idea or logic just tell me then i will implement

13. ## Re: need program logic

Originally Posted by anonymouss
iam not asking to write the program or write the enter code, let me clear int a[]={2,10,15,2 ,8};i want to remove duplicates and writted output as 2,10,15,8,how to remove duplicates if anyone have idea or logic just tell me then i will implement
Put them in a Set<Integer> and create a new array from that set.

kind regards,

Jos

14. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

yeah i know set does not allow duplicate elements,so i want to remove them without using collections

15. ## Re: need program logic

Originally Posted by anonymouss
yeah i know set does not allow duplicate elements,so i want to remove them without using collections
Ah, you want a cripple 'beginners' solution with for- and while-loops, a few if-statements here and there and possibly a few funny flags instead? How strange ...

Jos

16. ## Re: need program logic

Originally Posted by anonymouss
yeah i know set does not allow duplicate elements,so i want to remove them without using collections
Should be no problem for you:
iam not basic learner

17. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

Originally Posted by PhHein
Should be no problem for you:
ha,but struck up with logic

18. ## Re: need program logic

Originally Posted by anonymouss
ha,but struck up with logic
There is (almost) no logic at the application level in the suggestion in reply #13.

Jos

19. Member
Join Date
Apr 2013
Posts
26
Rep Power
0

## Re: need program logic

Originally Posted by JosAH
There is (almost) no logic at the application level in the suggestion in reply #13.

Jos
k thanks i ll try myself, k let me tell java doesnot execute line by line then how to understand program when we are looking at ,i want to know exceution process for below program
Java Code:
``` public class Bubblesort
{
public static void main(String arsg[])
{
int i;
int array[] = {12,5,4,85,18,1,3,10};
System.out.println("Values Before the sort:\n");
for(i = 0; i < array.length; i++)

System.out.print( array[i]+"  ");
System.out.println();

int n=array.length;
bubble_srt(array, array.length);

System.out.print("Values after the sort:\n");
for(i = 0; i <array.length; i++)
System.out.print(array[i]+"  ");
System.out.println();
System.out.println("PAUSE");
}

public static void bubble_srt( int a[], int n )

{
int i, j,t=0;
for(i = 0; i < a.length; i++)
{
for(j = 1; j < (a.length-i); j++)
{
if(a[j-1] > a[j])
{
t = a[j-1];
a[j-1]=a[j];
a[j]=t;
}
}
}
}
}```

20. ## Re: need program logic

Originally Posted by anonymouss
k thanks i ll try myself, k let me tell java doesnot execute line by line then how to understand program when we are looking at ,i want to know exceution process for below program
You haven't written this code yourself, have you? Otherwise you wouldn't have asked this. And please stop asking different questions all the time without properly discussing the replies to your previous questions.

Jos

Page 1 of 3 123 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•