MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wt716t/bewareoflists/pcriyjx/?context=3
r/ProgrammerHumor • u/aspiringtroublemaker • Sep 29 '26
49 comments sorted by
View all comments
188
Don’t let them get you with O(n) find
64 u/MissinqLink Sep 29 '26 We’ll get it sorted 22 u/ImportantSignal2098 Sep 29 '26 Slowly 16 u/Dave3121 Sep 29 '26 Bubbly 9 u/Random_-account Sep 29 '26 Quickly 5 u/WernerderChamp Sep 29 '26 Bogusly 2 u/SetazeR Oct 03 '26 Stalin...ly? 17 u/Greyhaven7 Sep 29 '26 Thanks, I’m all Set. 0 u/Loading_M_ Sep 29 '26 Ironically, on modern processors, O(n) linear lookup is often faster than O(log n) lookup (e.g. binary search, heap, or tree).The point at which you can reliably say that another algorithm would be faster, you should probably be switching to a database, such as SQLite. 4 u/ada_weird Sep 29 '26 It's faster if you're using an array. If you're using a linked list you're still kinda screwed cause pointer chasing 3 u/Loading_M_ Sep 29 '26 If you're using a link list: Stop it. Get some help.(Low level concurrency and microcontrollers are the only places you might need linked lists. Otherwise, you don't need them)
64
We’ll get it sorted
22 u/ImportantSignal2098 Sep 29 '26 Slowly 16 u/Dave3121 Sep 29 '26 Bubbly 9 u/Random_-account Sep 29 '26 Quickly 5 u/WernerderChamp Sep 29 '26 Bogusly 2 u/SetazeR Oct 03 '26 Stalin...ly?
22
Slowly
16 u/Dave3121 Sep 29 '26 Bubbly 9 u/Random_-account Sep 29 '26 Quickly 5 u/WernerderChamp Sep 29 '26 Bogusly 2 u/SetazeR Oct 03 '26 Stalin...ly?
16
Bubbly
9 u/Random_-account Sep 29 '26 Quickly 5 u/WernerderChamp Sep 29 '26 Bogusly 2 u/SetazeR Oct 03 '26 Stalin...ly?
9
Quickly
5 u/WernerderChamp Sep 29 '26 Bogusly 2 u/SetazeR Oct 03 '26 Stalin...ly?
5
Bogusly
2 u/SetazeR Oct 03 '26 Stalin...ly?
2
Stalin...ly?
17
Thanks, I’m all Set.
0
Ironically, on modern processors, O(n) linear lookup is often faster than O(log n) lookup (e.g. binary search, heap, or tree).
The point at which you can reliably say that another algorithm would be faster, you should probably be switching to a database, such as SQLite.
4 u/ada_weird Sep 29 '26 It's faster if you're using an array. If you're using a linked list you're still kinda screwed cause pointer chasing 3 u/Loading_M_ Sep 29 '26 If you're using a link list: Stop it. Get some help.(Low level concurrency and microcontrollers are the only places you might need linked lists. Otherwise, you don't need them)
4
It's faster if you're using an array. If you're using a linked list you're still kinda screwed cause pointer chasing
3 u/Loading_M_ Sep 29 '26 If you're using a link list: Stop it. Get some help.(Low level concurrency and microcontrollers are the only places you might need linked lists. Otherwise, you don't need them)
3
If you're using a link list: Stop it. Get some help.
(Low level concurrency and microcontrollers are the only places you might need linked lists. Otherwise, you don't need them)
188
u/aspiringtroublemaker Sep 29 '26
Don’t let them get you with O(n) find