in reply to Re: Comparing each element of Array A to Array B
in thread Comparing each element of Array A to Array B

The difference between your solutions and those previously posted is speed. Yours is O(N*N), whereas those previously posted are a much faster O(N).
  • Comment on Re^2: Comparing each element of Array A to Array B

Replies are listed 'Best First'.
Re^3: Comparing each element of Array A to Array B
by eric256 (Parson) on Aug 09, 2007 at 20:58 UTC

    True, but the example data was small and some times its more important to do it in a way that makes sense than the fastest way. I know when i started hashes where confusing concepts since they barely exist in other language, true they are now one of my favorites, but if you are new and someone solves an array problem with a hash solution it can be confusing.


    ___________
    Eric Hodges