Random commentary about C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
1. sort the numbers of set A2. sort the numbers of set B3. perform ordered list intersection in a way similar to the inverted list intersection (i.e. maintain two pointers and compare the items pointed by the pointers. Progress the pointer pointing to the smallest int, or progress both pointers when a common item is found)4. For more efficiency place skip pointers on the second sorted list every sqrt(10^6) items. For every item in list A, perform a binary search for the correct skip pointer and place pointer B in the skip pointer you've found.