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

前端 未结 14 585
广开言路
广开言路 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 12:05

    Big-O is important in algorithm design more than day to day hacks. Generally you don't need to know Big-O unless you are doing work on a lot of data (ie if you need to sort an array that is 10,000 elements, not 10). In a lot of cases, their are libraries that handle the tricky stuff for you (like a built in sort function), but in some cases you need to do it yourself.

    Bottom line is that Big-O is fairly easy to learn, so just learn it. It will help you in a bunch of cases.

提交回复
热议问题