Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: How to check lines that start with the same word then delete one of them

by rsFalse (Chaplain)
on Apr 10, 2020 at 15:13 UTC ( [id://11115323]=note: print w/replies, xml ) Need Help??


in reply to Re^5: How to check lines that start with the same word then delete one of them
in thread How to check lines that start with the same word then delete one of them

I think your solution works in O(n*log n), because searching an item in a hash takes log n. Am I right? Still much much faster that O(n*n) :)
  • Comment on Re^6: How to check lines that start with the same word then delete one of them

Replies are listed 'Best First'.
Re^7: How to check lines that start with the same word then delete one of them
by Laurent_R (Canon) on Apr 10, 2020 at 15:42 UTC
    No, a hash lookup is usually O(1), it does take some time, sure, but the time it takes does not depend (generally) on the hash size.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found