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

前端 未结 14 608
广开言路
广开言路 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:50

    I am reading answers and I (seriously) think that big-O is underestimated.

    As coders who make money from coding, we need to know what big-O is and why we need it.

    Let me explain what I think: Big-O notation is the efficiency/performance of your work. You have to know how fast your code works when the inputs get bigger because in real life you can't know the exact number of inputs. Furthermore, you can't compare two different algorithmic approaches without an asymptotic notation so if you want to choose the better one, you are going to compare them with big-O and see which one fits your situation. Both may be inefficient but you will know which one is better.

提交回复
热议问题