4 ms·
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 *
by alrs 14y ago
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.
- dredmorbius 14y ago'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.
- Ralith 14y ago"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.