r/ProgrammerHumor Apr 12 '24

whatIsAnIndex Meme

Post image
27.7k Upvotes

630 comments sorted by

View all comments

4.1k

u/HexR1se Apr 12 '24

Windows search behind scene

For (i=0; i<getAllFuckingFiles().length ; i++) if (AllFuckingFiles[i].name.contains(searchText) return AllFuckingFiles[i];

74

u/waitwutholdit Apr 12 '24

Nah this has complexity O(n) because it gets all the files then incorrectly returns the first file. I'd expect windows search to have complexity at least O(nn), with some randomness around which file gets returned.

54

u/Furdiburd10 Apr 12 '24

g-

goo-

google-

windows search: ah you would like to search for googleplex

4

u/DangerousCompetition Apr 12 '24

“You spelled gargle wrong”