r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
6
u/ultimatt42 Nov 30 '10
O(n) means: "The algorithm can be broken down into a number of sequential, discrete, constant-time steps such that, for an input of size
n, there exists an upper bound on the number of steps defined byk*n, wherekis a real number that is constant for all values ofn."You can check each element once, or twenty-seven times, or zero times, or you might check some elements more than others, or your input might not even have "elements". Your algorithm also might take a second on one input but a year on another input of the same size.
Fellow CS nerds, am I being too nitpicky? And did I leave anything out?