Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Match string in array

by sauoq (Abbot)
on Oct 03, 2005 at 19:18 UTC ( [id://497030]=note: print w/replies, xml ) Need Help??


in reply to Re: Match string in array
in thread Match string in array

Everytime you use grep, you are iterating through the list. Since you do that inside of loop, your algorithm is O(N*M). In contrast, JediWizard iterates once through a loop so his algorithm is linear. His approach is also conceptually simpler which results in cleaner code.

-sauoq
"My two cents aren't worth a dime.";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://497030]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found