Skip to main content

Command Palette

Search for a command to run...

Learning about Big O

What the heck is Big O!?

Updated
1 min readView as Markdown
Learning about Big O
S

Github: https://github.com/HODLBAEK

<Software Engineer> I'm a self-taught Frontend Developer passionate about web development. I use HTML, CSS, Sass, Javascript, React.

As an ex-banker, I also am very passionate about #BTC and what it could mean to humanity and money as we know it.

I'm starting my Data Structure and Algorithm course on Udemy. It's a pretty beginner course which would, hopefully, set me up for understanding the Leetcode problems. Learning about the concept of Big O

1. O(n) - O of n. Iteration

  • Drop the constant(when you have two single for loops)
function logItems(n){
for (let i = 0; i< n; i ++){
console.log(i)
for (let j = 0; j< n; j ++){
console.log(j)

2. O(n^2) - O of n squared. aka loop within a loop

  • Drop Non-Dominants = when you have O(n) and O(n^2) together, you drop O(n).

3. O(1) - O of 1 aka constant time.

  • The most efficient Big O.

4. `O(log n) - O of log n. aka Divide and Conquer

BigO.PNG

#conclusion

Big O is one of the fundamental tools for software engineers to analyze the cost of an algorithm. You can find more info on Big O by following this Link(https://www.bigocheatsheet.com/)

Datastructure&Algorithm

Part 1 of 2

I will be covering Data Structure & Algorithms as I begin my learning process.

Up next

Data Structure: Linked Lists(LL)

Linked Lists