Hey everyone. In this video, I’m going to give you an introduction to Big O notation and time complexity. These concepts basically give you one way of describing how the time it takes to run your function grows as the size of the input grows. To see what I mean by that exactly, let’s take a look at a few examples here. First of all, let’s say you are given an array like this and let’s say that this array could be of any lengths. It could be one hundred elements long, a thousand elements long or even one hundred thousand elements. And let’s say you want to write a function that takes this array and returns the sum of all the numbers in this array. So, in your function you wanna add up all the numbers of this array and returns the sum. And that function might look like this function right here and I’m gonna use pseudocode here to write this function. So, first of all let’s define our function that gonna be called find sum which is going to take given array as input and then inside this function first of all we gonna initialize a variable called total to 0 and then for each i in this given array or for each number total to 0

The last example is not quite correct. Finding the sum of the 2D array is still a linear time operation with respect to the size of your input. It is just that the size of your input is NOT N, it is N^2. For an array of size N, the number of items in the array is N^2, and since you have to deal with all the items, they define your input size. Given that the input size is N^2, we can call it M now, then the runtime complexity is T = O(M), which is linear with respect to the input size.

Thanks Dojo.It was very helpful as always 😃

We express constant time as O(1) as it is equivalent to O(n^0).

Anything raised to the power 0 is 1.

So we can only express it as O(1) which is not equivalent to O(2) or O(3) and so on as you demonstrated at 14:56.

Thank you

How do i learn English efficiently both writing and speaking..

Thank you ! 😍👌

Yes sir,I'd love to know a more mathematical way to recognize big O

O(Log n) and O(nlog n) notation were the one which should have required more attention

I'm sorry but the 151 people who disliked this video need Big O explained to them in crayon. This video is perfect.Thanks a million!

Thank you🍁🍁Love from India💜

Please make more videos on data structures and algorithms

What I am failing to understand is how you got the values for the array for the output of 5 and 10. My reading skills of code isn't too great and I am rusty at the moment. Can you explain it ? thanks

I wish you were my university lecturer – so happy to have found this!! 🙂 It made things make so much more sense!

Wow. Just wow. You made it look so simple. Complexities seemed nightmare before this lecture.

Can you also please explain Merge Sort's complexity?

Thanks in advance. 😃😃😃

you are just great!

estás cabrón compita, arigato chino-kun

Yes I need a formal video on big oh notation

Sir please can you make a separate video on Formal mathematical definition of Big-O ?

It would be great. Thanks 🙂

I watched this shit at 2X.

Subscribed and liked. Thank you

brilliant explanation!

you make it look really simple ! Thanks

Hi, have you seen the Berlekamp–Massey algorithm? The time complexity is defined as O(n^2), where n is the input data. Can I asume the same space complexity?

Thank you so much for explaining this. I have a quiz on Big O analysis tomorrow and I was completely lost before watching this video.

really nicely done with painstaking detail and examples – thank you

Thanks man u made my day! I was stuck at this topic at my college and u made it easy for understanding. Please make more videos on data structures.

17:41 – how to find time complexity

This is by far the best explanation about such topic. Really thanks!

I really request you for the BigO video. Please do…

thanks

Excellent!!

I just want some more video on this topic🙌💯

Great explaination YK👍

It's a shame for me that I have worked with various types of projects but I don't know basic things like this, thank you, you just made my day! 🙂

perfection for a beginner 👌

The mathematical rigorous explanation of Big O Notation would be much appreciated, brother. Thank your for the videos. 😀

INCOMPLETE

Don't waste 36 mins

!

I was about to Google Big O Notation when this video appeared in my recommendation and it clears out everything!! Many Thanks!

This is an amazing series man. You really explain soo good. Want to learn everything from you. Lots of love from India 😍😍

This just might save my sem.

Thanks a lot this was great. Would be perfect if there was a 6min version of this, kinda wordy and you lost me many times .

YK, just wanted to say how much I appreciate you for dedicating your valuable time and knowledge to the youtube community of developers. I am starting out fresh as a software developer and CS major this fall. Your videos are excellent learning tools are are helping me to grasp the discipline so thanks man!

T = c1 * n^2 + c2 * n^2 what will be the Time complexity?

Superbbb great

CS Dojo,

Can you make video on binary tree and avl tree and heap?

If all elements enqueued and all elements dequeued in circular queue then front=0 and rear = size-1 which is the condition of full queue but it is empty .why???

Thanks a lot, YK, you are such a good lecturer, i learned more here than my graduate classes!

My favorite algorithm website with code samples is http://algorithmexamples.com/

Awesome ! Thank you for the video

Is this an okay way to implement the find_sum_2d function in python?

def find_sum(arr):

total=0

for i in range(len(arr)):

for j in range(len(arr[i])):

total+=arr[i][j]

return total

let me know if theres an easier way

You are soooo good i can see why Google hired you. Thanks for the explanation. It is been a while since i needed to remember all of this and it just pops in my mind when you explain it like that.

Thanks!

Awesome explanation! Love this

This video is still understandable in 3x speed, and barely understandable in 4x speed. You really ought to talk faster, or to upload the video at an edited speed. The best speed I found was 2.5x

This video is a gem

Big backch00di ha. Yee too.🤔 😤

python is worse than pseudocode. there i said it.

grabs popcornWhat tool is being used to do the live illustrations and click-to-show coding? Thanks.

Very good. Thanks!

Hey Dojo, it was pretty nice explaination looking for more videos on algo and ds..

so a function with 100 for loops will have the same time complexity as the function with only one for loop?!

Is finding the fastest growing term actually the limit of function T when n goes to infinity?

How do I calculate while loop?

Thank you for this video, I will be keeping up to date with you data structures class just as some extra help as I just started data structures class and want to learn as much as possible

Excellent dude, I wish, I would have a teacher like you.

THANK YOU FOR THIS VIDEO CANT UNDERSTAND MY PROFESSOR BUT BRO YOU NAILED IT!

Excellent explanation

14:41 if you're removing all the coefficients then the 1 will also be removed.Instead of that you may write the function as

0.115 * x to the power 0 so that variable x remains according to the rule(anything to the power zero is 1).

we wait more about Algorithm and DataStructure from you and thanks for your effort and your simple way

is this part of measuring complexity

i got a book

which is very expensive in my country

some bunch of experts and phds wrote it

trust me , the book is just bunch of shittiest explanations i have ever seen

now i feel you taught me this for free

and its blessing for me

Thank you ♡♡♡

Helpful presentations however the empty boxes you show are kind of annoying. It's better when one can look at the entire code in a glance.

It's clear you know this material, but you spend far too much time tediously explaining the same things over and over. This could easily have been 10 minutes or less.

I wasted my tuition fees.

Why did you call that array 2D when it contained 3 arrays? Isn't that supposed to be 3D? Sorry for the noob question…

Thanku very much such a nice explanitaion ..day after tomorrow is my exam and now the concept are getting clear 😀😀😄😃🤟🏻

👍👍

Makasih kk

谢谢小哥哥讲解！很清晰！

24: for loop runs n+1 times wouldn't that be written n+1*O(1)?

Excellent video!. I love the way you narrated the Big O Notation and Time Complexity with good examples. Thanks!

It helped. KIU.

I want to find Big-O notation complexity step by step…Anyone help me …?

I've to complete my assignment…right now

I wish this series could continue forever. 30 minutes of CS Dojo teaches more efficiently than all the classes at my university combined.

ok this video makes me subscribe this channel.

A very good and detailed explanation of Big O notation and time complexity. I'm a college student and I took Data Structure course before but the professor was suck so that I end up did not learn any knowledge about Data Structure. After I watched this video, I really hope that you were my professor at the time that I was learning Data Structure. Excellent video.

If only had x1.5 speed in real life lectures

22:30 isn't the for loop O(N)

Love all ur vids!💜

need to learn this an interview, best decision to click on this video

For more on algorithms, go to algorithmplus.com

{}{}{}{{{{}}{{}}}}}😑

lol oooookay slow down their Asian kid. really living up to that stereotype

very nice explained!

Have an exam tomorrow. It will have some Big O, I feel so much better about it after this video. Thank you so much.

CS Dojo, you need to create your own MOOC or something. I swear to god, I would drop cash to buy your course. You explain everything so succinctly and clearly. You are god-tier at explaining this stuff. I WILL GIVE YOU MONEY!!

老公，我太可以了吧

Great tutorial! Very Helpful! The Instructor is very knowledgeable about the subject and presents the information very clear and concisely, more youtube tutorial presenters should learn to focus on this style presentation format. Thank you for this very helpful video! Sub/d!

{{ : ]__~~ robogenus }}