A thing I just realized when talking to a colleague who isn't an engineer: you know how there is an O(N) way and an O(N^2) way to answer the question "Which lines in this CSV file have an email address which is not unique in the file?" ? Well:
-
-
(If you're wondering what this O(N) vs O(N^2) thing means: it's notation used in computer science to describe the asymptotic time complexity of an algorithm. That's a mouthful. In less specialized language, the distinction is "Do I have to compare every item to every other one?")
Show this thread -
"How do you tell than a list with 100,000 words in it doesn't include a duplicate without checking each word against every other word, Patrick?" Excellent question! Answer: you stuff each word as you're checking it into hash table and then you only have to go through list once.
Show this thread
End of conversation
New conversation -
-
-
Surely it's only easier to write if you already have a hash table implementation.
-
Yes, pre-requisites to writing the code include a hash table implementation and also electricity, but you can assume the ready availability of both in almost all circumstances relevant to a professional software company.
- 1 more reply
New conversation -
-
-
‘cut | sort | uniq’ -something I’d need to look up in the man page cut and uniq are likely both O(n), the question is what does sort do
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.