Re: find words not in an array
From: Joe Smith (joe_at_inwap.com)
Date: 03/28/05
- Next message: chung.ley_at_amd.com: "My option when a module is not available for my production OS."
- Previous message: mbstevens: "Re: find words not in an array"
- In reply to: mbstevens: "Re: find words not in an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Mar 2005 11:09:40 -0800
mbstevens wrote:
> # A: I like a subroutine version for clarity.
> foreach my $w (@wordlist) {
> if ($sought eq $w)
Your solution does not scale well. If @wordlist and @testlist
have 1000 words each, the brute-force method requires 1000000
string comparisons instead of just 2000 hash operations.
The answer found in the FAQ is better.
-Joe
- Next message: chung.ley_at_amd.com: "My option when a module is not available for my production OS."
- Previous message: mbstevens: "Re: find words not in an array"
- In reply to: mbstevens: "Re: find words not in an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|