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

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

    Think of efficiency, my friend!

    The difference can be seen if your boss is yelling at you to find the address of clients by their name and you are given a huge pile of unsorted papers and an address book indexed by name!

    In big-O notation, this is O(n) - running through your huge pile of unsorted paper, and O(1) - looking up the index by name.

提交回复
热议问题