Click here to Skip to main content
16,015,942 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Applicatin as TrayIcon? Pin
Hamid_RT31-May-06 21:44
Hamid_RT31-May-06 21:44 
GeneralRe: Applicatin as TrayIcon? [modified] Pin
bosfan31-May-06 22:16
bosfan31-May-06 22:16 
AnswerRe: Applicatin as TrayIcon? Pin
Benoy Bose31-May-06 21:40
Benoy Bose31-May-06 21:40 
AnswerRe: Applicatin as TrayIcon? Pin
Benoy Bose31-May-06 21:42
Benoy Bose31-May-06 21:42 
AnswerRe: Applicatin as TrayIcon? Pin
Hamid_RT31-May-06 21:47
Hamid_RT31-May-06 21:47 
GeneralRe: Applicatin as TrayIcon? Pin
bosfan1-Jun-06 3:08
bosfan1-Jun-06 3:08 
Questionhow to compute set intersection efficiently? Pin
George_George31-May-06 21:18
George_George31-May-06 21:18 
AnswerRe: how to compute set intersection efficiently? Pin
David Crow1-Jun-06 4:58
David Crow1-Jun-06 4: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


GeneralRe: how to compute set intersection efficiently? Pin
George_George1-Jun-06 18:41
George_George1-Jun-06 18:41 
GeneralRe: how to compute set intersection efficiently? Pin
David Crow2-Jun-06 2:51
David Crow2-Jun-06 2:51 
AnswerRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 14:20
Stephen Hewitt1-Jun-06 14:20 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 18:45
George_George1-Jun-06 18:45 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 18:54
Stephen Hewitt1-Jun-06 18:54 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 19:06
George_George1-Jun-06 19:06 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 19:21
Stephen Hewitt1-Jun-06 19:21 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 20:13
George_George1-Jun-06 20:13 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 20:17
Stephen Hewitt1-Jun-06 20:17 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 18:57
Stephen Hewitt1-Jun-06 18:57 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 19:09
George_George1-Jun-06 19:09 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 19:22
Stephen Hewitt1-Jun-06 19:22 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 20:16
George_George1-Jun-06 20:16 
QuestionLast Window Message [modified] Pin
HakunaMatada31-May-06 21:12
HakunaMatada31-May-06 21:12 
AnswerRe: Last Window Message Pin
Michael Dunn31-May-06 21:13
sitebuilderMichael Dunn31-May-06 21:13 
GeneralRe: Last Window Message Pin
HakunaMatada31-May-06 21:18
HakunaMatada31-May-06 21:18 
QuestionVisual C++.NET and VS C++ 6.0, are they the same? Pin
DzungLean31-May-06 21:07
DzungLean31-May-06 21:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.