Success !!!

Discussion in 'C++' started by John Everett, Jul 4, 2003.

  1. John Everett

    John Everett Guest

    Thanks to your suggestions...

    I have fixed the problem.
    I have reduced the search from 10 minutes to 5 seconds.

    I combined the C++ STL map ability with a PERL trick.

    1. I turned both dot lists in to strings for simplicity of comparison.
    2. I loop through A_dots and associated the xyz_string with 1.

    typedef map< char, int > char_int_map;
    char_int_map search_map;

    // while looping though A_dots
    search_map ["33.224 31.332 11.332"] = 1


    3. Then I loop through B_dots and test for the presence of the dot
    in the map.

    for ( int x=0; x<=100000; x++ )
    {
    if ( ! search_map[ B_dots[x] ] )
    {
    // record the dot since it is not in A_dots
    }
    }

    Thanks,
    John
    John Everett, Jul 4, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MCDONAMW
    Replies:
    4
    Views:
    594
    MCDONAMW
    Sep 28, 2004
  2. DC

    ASP.NET success stories?

    DC, Dec 2, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    940
    Jeff Evans
    Dec 4, 2004
  3. =?Utf-8?B?UmFt?=
    Replies:
    1
    Views:
    474
    ViewState
    Oct 21, 2005
  4. Replies:
    2
    Views:
    3,654
  5. =?Utf-8?B?eXVjaGFuZw==?=
    Replies:
    1
    Views:
    1,704
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Apr 8, 2006
Loading...

Share This Page