본문 바로가기
Algorithms, data structure/개념

Intro to Big O Notation

by CodeMia 2022. 4. 9.

Big O 

a numeric representation of the performance of code. 

 

 

Why should we use Big O? 

Let say there is a problem having 10 different solutions. 

how performs compared to others? 

 

1. we need to have a precise vocabulary to talk about how our code performs. 

 

2. It's also good for discussing trade-offs between different approaches.

because often it's not as cut and dried as I made it seem, it's not that one solution is always great and others are terrible.  

 

3. If you trying to debug your code, it helps to understand things that are slowing it down, not just looking for errors, but let's say that your code is working but for some reason, it's taking a lot longer than you expect or your computer is lagging and freaking out in the browser when you execute some function. 

We can actually pinpoint where some problems might arise. So Big O helps us identify inefficient points. 

 

trade-off 교환

 

 

Who cares?

1. interviewing, technical interview, code challenges

2. large company

where you're working with a large data set, like hundred of millions of pieces of data

where one algorithm implementation could save an hour every time it runs compared to another implementation. 

 

 

 

'Algorithms, data structure > 개념' 카테고리의 다른 글

Big O Time quiz  (0) 2022.04.10
Simplifying Big O Expressions  (0) 2022.04.10
Big O Notation  (0) 2022.04.10
[Big O] Timing our code  (0) 2022.04.09
브라우저 콘솔 스닙핏 여는 법 | opt+cmd+J (맥)  (0) 2022.04.09

댓글