Suppose I have two lists of objects and I would like to match each object in the list with each object in the list .
It will probably come immediately with one that will be the algorithm.
for (it_1 = list_1.begin (); it_1! = List_1.end (); It_1 ++) {for (it_2 = list_2.begin (); it_2! = List_2 .end (); it_2 ++) {// Match match now (* it_1, * it_2); }} I wonder if there is a better way to do this or not. It requires O (N1 * N2), where N1 and N2 are the lengths of list_1 and list_2, respectively.
You can use multi threading by diving 1 to 2 or 3 parts of the list size and Look at the efficiency, and run the match 2 algorithm in the list with 2 in each thread and the result can call the caller back.
See if it helps.
Comments
Post a Comment