15,790,917 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Re: Applicatin as TrayIcon? Hamid_RT31-May-06 22:44 Hamid_RT 31-May-06 22:44
 Re: Applicatin as TrayIcon? [modified] bosfan31-May-06 23:16 bosfan 31-May-06 23:16
 Re: Applicatin as TrayIcon? Benoy Bose31-May-06 22:40 Benoy Bose 31-May-06 22:40
 Re: Applicatin as TrayIcon? Benoy Bose31-May-06 22:42 Benoy Bose 31-May-06 22:42
 Re: Applicatin as TrayIcon? Hamid_RT31-May-06 22:47 Hamid_RT 31-May-06 22:47
 Re: Applicatin as TrayIcon? bosfan1-Jun-06 4:08 bosfan 1-Jun-06 4:08
 how to compute set intersection efficiently? George_George31-May-06 22:18 George_George 31-May-06 22:18
 Re: how to compute set intersection efficiently? David Crow1-Jun-06 5:58 David Crow 1-Jun-06 5:58
 The first thing to do is sort the sets, like: ```int set1[7] = {5, 2, 0, 2, 8, 7, 5}; int set2[7] = {2, 8, 8, 7, 0, 9, 9}; qsort(set1, 7, sizeof(int), compare); qsort(set2, 7, sizeof(int), compare); ... int compare( const void *arg1, const void *arg2 ) { return *(int *) arg1 - *(int *) arg2; }```Now you can compare the items in the first set with the items in the second set, making a note of the matches. If the current item in the first set is less than the current item in the second set, go to the next item in the first set. If the current item in the first set is greater than the current item in the second set, go to the next item in the second set. Otherwise the two numbers match so add the item to the third (output) set, and go to the next item in both the other two sets. Make sense? "The largest fire starts but with the smallest spark." - David Crow
 Re: how to compute set intersection efficiently? George_George1-Jun-06 19:41 George_George 1-Jun-06 19:41
 Re: how to compute set intersection efficiently? David Crow2-Jun-06 3:51 David Crow 2-Jun-06 3:51
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 15:20 Stephen Hewitt 1-Jun-06 15:20
 Re: how to compute set intersection efficiently? [modified] George_George1-Jun-06 19:45 George_George 1-Jun-06 19:45
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 19:54 Stephen Hewitt 1-Jun-06 19:54
 Re: how to compute set intersection efficiently? [modified] George_George1-Jun-06 20:06 George_George 1-Jun-06 20:06
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 20:21 Stephen Hewitt 1-Jun-06 20:21
 Re: how to compute set intersection efficiently? [modified] George_George1-Jun-06 21:13 George_George 1-Jun-06 21:13
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 21:17 Stephen Hewitt 1-Jun-06 21:17
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 19:57 Stephen Hewitt 1-Jun-06 19:57
 Re: how to compute set intersection efficiently? [modified] George_George1-Jun-06 20:09 George_George 1-Jun-06 20:09
 Re: how to compute set intersection efficiently? [modified] Stephen Hewitt1-Jun-06 20:22 Stephen Hewitt 1-Jun-06 20:22
 Re: how to compute set intersection efficiently? [modified] George_George1-Jun-06 21:16 George_George 1-Jun-06 21:16