Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have a Debian laptop.

ls -alh | wc -l returns 89. I can subtract "..", ".", and the "totals" lines, so that's 86 init scripts.

Big O for 86 scripts is 86 * n, which simplifies to "n". I'm not concerned.



'ls -A | wc -l' will spare you having to account for the '.' and '..' lines. Omitting the '-l' (redundant for your case) also spares the "totals" line.


"Oh, and because each script runs in less than an hour, we can just say n = 1 hour, and that's a constant, so it simplifies down to instant!"

Yeah, that's not how computational complexity works.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: