magicalclick said:
Sven Groot said:
*snip*
I am not talking about what BigO is for. I have being saying we don't want explosion of compution from the begining.
In real life, Big O is most important for the design and architecture review. The C is important during code reviews, development, and testing. If you can't get the right algorithm to scale for your problem, you are doomed. Once you have the right algorithm,
you should use a profiler and measure the best way to reduce the cost of "C". For school, it seems like the right thing to focus on is BigO since the amount of time spent on performance tuning is really about finding a good balance of meeting real world requirements
and managing cost of development. In school, they don't tend to focus on the best compiler settings for performance, measure unit test coverage, do threat models, run PreFast, or other such tasks, so in most cases, they also don't focus on other optimizations
that are constant time.
BTW, the constant time is sometimes considered upfront in real world applications if it is obviously going to be a problem. For example, for each N, do you need to go to memory, disk, or network? Knowing some of these things can change an algorithms design
(maybe do work in batches of 1K N instead of individual N, especially if N is going to be very big).