Code Example: If there is no input, then it’s called a constant time algorithm. For example: for (int i = 0; i < 1000000; i ++) x++; above is O(1) ------------------------------------------------------------------------------ Let’s go through some code samples and analyze their runtime complexity. for (int i = 0; i < N; i ++) x++; All we need to do is count the number of times the statement x++ will execute. Clearly, it’s N, so the time complexity is O(N), also called linear. ------------------------------------------------------------------------------ for (int i = 0; i < N; i++) for (int j = 0; j < i; j++) x++; How many times the statement x++ execute: So the time complexity is O(N^2), also called quadratic. --------------------------------------------------------------------------- Logarithmic Runtime ************************************************** Iterating powers of a number # Let’s analyze the loop below where we iterate over all powers of 2 for (int i = 1; i = 1; i /= 2) x++; --------------------------------------------------------------------------- Harmonic series # Consider the piece of code below: for (int i = 1; i
@@pallavig3187 count how many times code is executed in the for loop o(1) means only one time whereas o(n) means o(number of times code is executed) if the code it executed 5 times the n=5 so n(5)
Let's say we have a excel with data of students I will find the students name by using dictionary (since key cannot be duplicated ) it will be O(1) - search operation. Correct ? And also here memory will be taken more since we may have lot of students data Is my understanding correct ??
Operation is some calculation that your CPU performs. Eg: Adding two numbers. So, unga program ku evlo operations theva padumnu calculate panna time aagum. So, adha estimate panradhuku thaan we use Big O Notations.
Code Example:
If there is no input, then it’s called a constant time algorithm. For example:
for (int i = 0; i < 1000000; i ++)
x++;
above is O(1)
------------------------------------------------------------------------------
Let’s go through some code samples and analyze their runtime complexity.
for (int i = 0; i < N; i ++)
x++;
All we need to do is count the number of times the statement x++ will execute.
Clearly, it’s N, so the time complexity is O(N), also called linear.
------------------------------------------------------------------------------
for (int i = 0; i < N; i++)
for (int j = 0; j < i; j++)
x++;
How many times the statement x++ execute:
So the time complexity is O(N^2), also called quadratic.
---------------------------------------------------------------------------
Logarithmic Runtime
**************************************************
Iterating powers of a number #
Let’s analyze the loop below where we iterate over all powers of 2
for (int i = 1; i = 1; i /= 2)
x++;
---------------------------------------------------------------------------
Harmonic series #
Consider the piece of code below:
for (int i = 1; i
Thanks Dude
Broo yaaru Sami nee but thank you so much bro❤🤗 neeye pesama UA-cam channel aarambikalam bro❤
can you do this with python
A dout o(1) o(n) nu kandhupudhikuradu eppadhi andha code ha pattu edha count pannanum indha notations ha kandhupudhika pls yaravadu sollunga😢?
@@pallavig3187 count how many times code is executed in the for loop o(1) means only one time whereas o(n) means o(number of times code is executed) if the code it executed 5 times the n=5 so n(5)
I had a lot of confusion about Big(O) in college. But your explanation makes it crystal clear. Thanks bro🤗. Keep it up bro😊
Tnq u bro 4 this series I had a very big confusion and now cleared
Glad it was helpful! :)
Nice explanation 🎉...impressed
Thanks Bro,Good Explanation in Tamil, Keep going
Vere level bro neenga
Very clear explanation
Nice bro, good explanation
Eye opener
Bro Semma broooo........
Super explanation thanks anna 👍
Thank u so much
Bro can u please upload some video for big omega and big theta
Ipodhiku I am working on other videos. I have added this to my list. I will cover it in the future. Thanks for the suggestion! :)
@@CSinTamil k bro tnx👍
Anna, array la five elements iruthuna ippa voru elementa firstla insert pannuna athula five operation nadakuma O(5)
Nicely explained
Bro inthe series le full dsa upload pannirukkingelaa?
Playlist poi parunga
Epdi calculate panra endu sollunga bro
Thanks na😍😍😍👍
Let's say we have a excel with data of students
I will find the students name by using dictionary (since key cannot be duplicated ) it will be O(1) - search operation. Correct ?
And also here memory will be taken more since we may have lot of students data
Is my understanding correct ??
Super bro
Explain the Greedy , dynamic,brude force algorithm bro
Thanks
Programa apply panni soli tharunka Anna.
Bro what is mean by operations ?
Operation is some calculation that your CPU performs. Eg: Adding two numbers. So, unga program ku evlo operations theva padumnu calculate panna time aagum. So, adha estimate panradhuku thaan we use Big O Notations.
O (4) na idhu max operation or minimum or fixed operations ah?
👍
Does data structure fefers to program bro
which one is mostly uses!
Idk bro😢
Anna data structure ah just therichi. Irutha ppothuma illa practice pannanum Anna
Practice pannanum na apadi panni pakarathu anna
DS concepts oda sethu program pannavum theriyanum. Hackerrank.com is a good website to practice DS
Thanks for your reply anna 🤩
Oru function ku O() epdi find pannuvanga?
Andha function la enalaan operations nadakutho, adha N number of inputs kudutha evalo operations nadakumnu check panni kandu pudipaanga
@@CSinTamil ohh oky thanks
DAA class plz
Purila😥
😢
Bro How to contact you bro