What is the big deal about Big-O notation in computer science?

前端 未结 14 611
广开言路
广开言路 2021-01-31 11:30

How would Big-O notation help in my day-to-day C# programming? Is it just an academic exercise?

14条回答
  •  广开言路
    2021-01-31 11:53

    There's no "big deal".

    It all depends on the kind of work you're doing. If you're working on front end, you could spend months mired in all kinds of interesting and potentially complex things that don't have anything to do with Big O.

    If you're working in an organization suffering with scaling problems, you might find yourself an out of the box solution that suits all your needs, and you only need the ability to understand what Big O means, to properly understand the kind of performance you're going to get when you call X function. Or, it may be important for you in your work occasionally when you have to tie pieces together, or write a new algorithm that is a composite of others....

    The final case (<1%) is that you're working in academia, where of course the discovery of a new algorithm that is an improvement in order is a huge deal potentially, and it's going to be very important to your daily work. No one is probably going to have to tell you this, since it will be impossible to proceed down this path without recognizing that importance.

    When it comes to the interview process, it's a different matter altogether. I'm afraid it's a bit of a hazing process amongst us engineers. We do it to each other, but really we all let some of our knowledge that isn't as useful to our daily work degrade over time. Like most engineers, you're going to brush up when it becomes useful, so this isn't really a concern, other than the fact that when you quit / get fired you're going to have to interview again, so... best to simply chalk it up as one of those annoying things that humans do, and simply sacrifice the time required in preparation for the interview process. I like to think of it as honor-based. The courtesy of studying up on my algorithms shows honor to my next potential employer. Of course, they may see it differently, but that's not my place to say :)

提交回复
热议问题