2.3.1 Recurrence Relation Dividing Function T(n)=T(n/2)+1 #1

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 123

  • @amruteshmishra4921
    @amruteshmishra4921 4 года назад +328

    Thank you sir for reducing my time complexity of understanding time complexity !

  • @victoryosikwemhe3092
    @victoryosikwemhe3092 2 года назад +15

    The way he teaches is so relatable, no hidden magic, he unfolds everything

  • @samadhanghorpade2302
    @samadhanghorpade2302 Месяц назад +1

    01:06 Dividing functions call themselves for n by 2
    02:12 Recurrence relation T(n) = T(n/2) + 1 explained
    03:18 Recursion tree method for T(n)
    04:24 Reaching the base case of the recurrence relation T(n)=T(n/2)+1
    05:30 Algorithm time complexity is O(log n)
    06:36 Solving recurrence relation using substitution method
    07:42 Analyzing the recurrence relation T(n)
    08:41 Recurrence relation T(n) = T(n/2) + 1 results in Θ(log n)

  • @LcaptainoftheForsaken
    @LcaptainoftheForsaken 3 года назад +21

    You are absolutely amazing! For so long, I never understood how to do anything related to analysis of algorithms, but now I understand! Thank you so much for spending time with us to teach me what other professors have failed to do.

  • @asishraz6173
    @asishraz6173 4 года назад +5

    Wow, I loved the way I paused the video and did the substitution method and as well as tree method. Your way of teaching, making it easier and easier for all of us. Thank you so much, Sir.

  • @TheBardack99
    @TheBardack99 5 лет назад +14

    You are my Yoda of the computer science force

    • @sexychantu5066
      @sexychantu5066 3 года назад +2

      AAPKA NAAM KAISE BOLU MAI KUCH SMJ NAHI AARA. IS SE ACHE TO BIOLOGY MAI SCIENTIFIC NAMES HOTE HAI BHAI.
      THANKS AND REGARDS
      SEXY CHANTU

  • @akashkirthik9882
    @akashkirthik9882 5 лет назад +6

    Wow ! Nobody would have explained better ! Thank you sir ! Hope you make more videos !

  • @manaskundu5164
    @manaskundu5164 6 лет назад +5

    The way you explaining sir is just awesome..cleared all my doubts..Thank you very much sir.

  • @tallalomar3531
    @tallalomar3531 6 лет назад +7

    Thanks Prof. you are doing awesome job, the way you explain the algorithms , may God bless you

  • @it_rajat_parate6667
    @it_rajat_parate6667 2 года назад +1

    hello sir u are my Idol ,
    we students will never gets an teacher like you .
    you are Gr8 sir , I am personally Very Big fan of u . if any Moment of life I want to meet you .
    I competed your DS course on Udemy on limited period of time & Begin with algorithm course .
    Sirr One and only last request from you if possible , plz make an DSA problems Sheet with link of your solving Ans & give Related Question As HomeWork .
    THen Onwards yours course is fully completed And we students Gets fully Prepared for Product Based Company.
    if the DSA sheet is created By [ Abdul Bari sir. ] , I Gaurented all your Lovingly Students gets Happy and Thankuable for ur Favour.
    Thank You Very Much Sir. 🤗

  • @vakhariyajay2224
    @vakhariyajay2224 2 года назад +3

    Thank you very much. You are a genius. 👍👍🙏🙏👌👌🔝🔝

  • @urbanpendu3105
    @urbanpendu3105 6 лет назад +3

    @abdul bari ,U are doing a great job sir

  • @almas.arcula
    @almas.arcula 3 года назад +1

    I love your accent, kisses from Brazil!!

  • @AmitKumar-hh7de
    @AmitKumar-hh7de 3 года назад

    Thank you, sir, your videos are very helpful for me, I have seen many videos but now to see your videos my doubt is clear and understood the time complexity.

  • @forthecultstuff
    @forthecultstuff 3 года назад +1

    This is such an amazing simple explanation. Thankyouuu!! 😊😇

  • @prajan_jana
    @prajan_jana 4 года назад +8

    Sir thank you for sharing this video...sir can you put video for
    1. T(n)=T(n/2)+1. Where n=2↑k for all k greater than or equal to 0...
    2. T(n/3)+T(2n+3)+cn. Where c is constant & n is input size... please sir help me...

  • @shaneyaw4542
    @shaneyaw4542 3 года назад +1

    The textbook I am reading skipped so much material that it is also impossible to figure out without a good explanation. This wa sexcellent.

  • @Journeysandinsight
    @Journeysandinsight 2 года назад

    You are Pro now master theorem look obivious
    😍

  • @sriyapatturi915
    @sriyapatturi915 2 года назад +1

    Thank you sir for helping me understand this difficult subject of Algorithms in a simpler, digestable way :)

  • @rushikeshthawale
    @rushikeshthawale 5 лет назад +1

    Lots of Respect!

  • @vishalrikhi4297
    @vishalrikhi4297 3 года назад +1

    EXCELLENT YAAR EXCELLENT ITS JUST WOW

  • @devanshijoshi6338
    @devanshijoshi6338 6 лет назад +1

    Sir amazingly explained...... great job sir👍

  • @mohamemdtalbi3679
    @mohamemdtalbi3679 3 года назад

    You are the best thank You for This super course

  • @subramaniyanvg6367
    @subramaniyanvg6367 4 года назад

    Hats of to you sir awesome explanation .

  • @sushantaray9116
    @sushantaray9116 7 лет назад +4

    Sir your lectures are very much easy to understand and also very helpful for gate exam .
    I request you to upload some java tutorial videos ,especially Java Collection

  • @kavitajoshi6296
    @kavitajoshi6296 5 лет назад +3

    Thank you very much, sir, for such a simple straight explanation.
    I am getting problem while solving T(n)= T(n/4)+ C. The last step I obtained is 4C+T(n/2^8). how to solve next pl.guide.
    Pl. don't change the speed.this is required for other stream's students.

  • @manussa9778
    @manussa9778 5 лет назад +2

    Thank you!! God bless you.

  • @zahreddinesoualem3213
    @zahreddinesoualem3213 3 года назад +4

    sir, I'm so confused, what is the meaning of 1 step of each dividing !! and the level of the tree please these word are really frustrating

  • @youssefelatmani5899
    @youssefelatmani5899 4 года назад +3

    Hi sir, I hope you're fine.
    I just have a question please;
    when you finish your calculation, you find that "K= log n #base 2#"
    But when you write the complexity of time, you just write "O(log n) #without a sign to the base#"
    Is that right? because it may refer to any "base",
    or maybe because adding the"base" to complexity does not change anything, or the change is not that important.
    I just want you, if you want please, to tell me the reason behind that.
    have a good day Mr. Abdul Bari

  • @ryanjohnson2844
    @ryanjohnson2844 10 месяцев назад

    thank u! I was forgetting to count my O(1) steps in the recurrence relation lol, I was like ain't no way this algorithms is O(1)

  • @jeetpatel5735
    @jeetpatel5735 5 лет назад +1

    Sir, @5:09 How many steps it is taking ? Shouldn't it be ( k+1 ) ?

  • @renasbaran9204
    @renasbaran9204 2 года назад +2

    What is the time complexity of this function?
    public static float myst (float q, int n){
    float e = 0;
    if (n

  • @Dorianek8
    @Dorianek8 4 года назад +4

    7:10 isn't that "k" iteration?

  • @ivandrofly
    @ivandrofly 7 месяцев назад

    3:05 unity value for division and multiplication is 1

  • @josh-he3qg
    @josh-he3qg 3 года назад

    absolute unit !!!! thank you

  • @mohammedadel8948
    @mohammedadel8948 2 года назад

    Thank you , I appreciate your help so much

  • @tapasreedey2917
    @tapasreedey2917 3 года назад +1

    thank you so much!!

  • @inewue1
    @inewue1 6 лет назад +3

    I LOVE YOU !!!

  • @radhikagummerla8514
    @radhikagummerla8514 6 лет назад +1

    Thank you sir for clearing my doubt

  • @codetodecode299
    @codetodecode299 3 года назад

    very well explained

  • @둘반둘반
    @둘반둘반 Год назад +1

    Thank you so much!

  • @shwetapriyadarshani197
    @shwetapriyadarshani197 4 года назад

    Very clearly explained sir

  • @sudhakar7
    @sudhakar7 3 года назад +1

    Thank you sir !

  • @naveenchandrakumar480
    @naveenchandrakumar480 6 лет назад

    Terrific Lectures and the Teacher

  • @某李-s8l
    @某李-s8l 4 года назад +2

    太强了 老师!!!

    • @ankitcaring
      @ankitcaring 4 года назад +1

      bro reply in english so that other could understand bcz if u understand this video , u must know englsih

  • @sevprogramming
    @sevprogramming 4 года назад +1

    explained it way better than sorry ass professors at UNT, thank you!

  •  5 лет назад +1

    ¡Gracias!

  • @chuggachootales7131
    @chuggachootales7131 5 лет назад

    @Abdul Bari Sir how to solve T with two variables ? For example T(x, y) = Θ(x) + T(x, y/2) , T(x, c) = Θ(x) for c ≤ 2, T(c, y) = Θ(y) for c ≤ 2

  • @madhudwivedi3485
    @madhudwivedi3485 2 года назад

    Thanku so much sir

  • @KhoiLe-gq5rd
    @KhoiLe-gq5rd 8 месяцев назад

    if the recurrence relation was instead T(n)=2T(n/2) +1, at the base step, would be equivalent to 2^k T(n/2^k) +k right? If so, would that simply into n(1) +logn making this big theta(n)?

  • @haribabumuddada3864
    @haribabumuddada3864 6 лет назад +1

    excellent sir my concepts are very clear thank u so much sir

  • @yanbatista
    @yanbatista 2 года назад

    Thank you!

  • @SRNR_PODCAST.
    @SRNR_PODCAST. 3 года назад +1

    a gold mine in youtube

  • @atiquezaman8854
    @atiquezaman8854 2 года назад

    In the function, if we would take printf() 3 times, then would it be like T(n)=T(n/2)+1 T(n)=T(n/2)+3?? cause we are assuming the printf() line as 1.?

  • @chinmay52
    @chinmay52 6 лет назад +2

    Thank you for the video, I just have one question: if the function was returning Test(n/2)*Test(n/2), what would be the time complexity of that line?

    • @chinmay52
      @chinmay52 6 лет назад

      Abdul Bari thank you. Can I email you one question which is based on this?

    • @chinmay52
      @chinmay52 6 лет назад

      Thank you sir, didn't find your email so I have sent the problem on your Facebook page. Please check on Fb messenger.

  • @smrutiranjandas5466
    @smrutiranjandas5466 6 лет назад +3

    Plz tell me what happen in case of T(n)=2T(n/2)+nlogn

  • @chetankhanna8975
    @chetankhanna8975 5 лет назад +1

    Sir ..will we use big Oh notation in every question ? Plz answer quickly..

  • @22P928BilalFarooqSiddiqui
    @22P928BilalFarooqSiddiqui 11 дней назад

    sir while solving using the substitution method why we let k=log(n)?

  • @samiranroyy1700
    @samiranroyy1700 2 года назад

    Sir thank you

  • @martinusyordansindhuatmaja8457

    thankyou sir

  • @vittoriafrau1857
    @vittoriafrau1857 4 года назад +1

    Sorry to bother you sir (and thanks for the great videos), but for T(1)=0 what's the solution? O(1)?

    • @abdul_bari
      @abdul_bari  4 года назад +8

      yes 0 is constant so T(1) is O(1)

  • @shubham3079
    @shubham3079 5 лет назад +9

    sir, i'm having trouble solving this question :-
    T(n) = T(n/2) + T(n/4) + T(n/8) + n
    please give me a hint sir.

    • @vinitraj6268
      @vinitraj6268 4 года назад

      Yes sir please make a video on it.

    • @damonsalvatore8644
      @damonsalvatore8644 4 года назад +2

      ans: big-oh( 7^ log(base8)n )

    • @shubham3079
      @shubham3079 4 года назад

      @@damonsalvatore8644 please explain

    • @damonsalvatore8644
      @damonsalvatore8644 4 года назад +3

      @@shubham3079 Try recursive tree method.
      In the first iteration, the time will be n and in the second iteration, Time will be (7/8)n and then (7/8)^2*n and so on. We can see the pattern as n*(7/8)^k. So the T(n) will be n+((7/8)^1)n+((7/8)^2)n+....+((7/8)^k)n. Take n as common and form a geometric series like n[1+(7/8)+(7/8)^2+(7/8)^3+....+(7/8)^k].
      It is equal to n[(7/8)^k]

    • @damonsalvatore8644
      @damonsalvatore8644 4 года назад +3

      Now,T(n) will be 1 only if n=1...Note:n cannot be 0 here because of T(n/2),T(n/4) and if n==0, n/2^k=0 which gives our n as zero value. So go with n=1. In the given question ,the highest term is (n/8). So T(n)=1 when n/8^k =1 . Therefore k= log(base8)n.We will get T(n)= n[(7/8)^k].WKT n/8^k=1. So,T(n)=7^k which upon applying k value becomes T(n)=7^log(base8)n. Hence the value big-Oh(7^(logn)).

  • @ΓιάννηςΙωαννίδης-π7ξ

    Eisai levetnis

  • @codetodecode299
    @codetodecode299 3 года назад

    nice

  • @muhammadsaqlainabbas4419
    @muhammadsaqlainabbas4419 5 лет назад

    Sir, you mention in binary search algorithm time complexity same equation but there was your answer is that logn but here is log2n.Pls guide me

  • @PankajKP
    @PankajKP 6 лет назад

    First Like and then Comment GOD and then watch!!

  • @Deadpool-cz6rt
    @Deadpool-cz6rt 2 года назад

    Why are we using T(n) = 1 when n = 1. In previous videos we used, T(n) = 1 when n = 0. So I was wondering how did you figure out which value of n gives T(n) = 1?

    • @user-vv2kr
      @user-vv2kr 2 года назад +1

      This video is for deviding function . In division and multiplication unit or least value is 1. But in addition and subtraction unit value is 0. For previous cases (addition and subtraction functions) we could assign constant for 0 /unit value. Since sir said he prefer to assign 1 since it is also a constant. When we calculating time compexity all the constants can consider as same even though value is different :)

  • @shobhitsrivastava8876
    @shobhitsrivastava8876 3 года назад

    How can I calculate Theta notation using this method.

  • @sports-ft9se
    @sports-ft9se 5 лет назад

    Sir! T(n/2)=T(n/2)+1 is this right or T(n)=t(n/2)+1 ?

  • @vinnudhanu8223
    @vinnudhanu8223 3 года назад

    Sir why can't n

  • @siddhijoshi8759
    @siddhijoshi8759 4 года назад

    you are GOD !

  • @speak_charlie
    @speak_charlie 4 года назад

    👍

  • @LAG-24x7
    @LAG-24x7 6 лет назад +1

    so what is the answer if we put n/2^k =0

  • @SayanBanikAuthor
    @SayanBanikAuthor 9 месяцев назад

    5:32

  • @hadikleit8130
    @hadikleit8130 5 лет назад

    Sir can I solve it by using master theorem ? Isn't it faster ?

  • @shamparoy5394
    @shamparoy5394 5 лет назад

    Sir on starting of ur video the first questions sol is big oh(log n) but i have a doubt thay why big oh..why not omega because log n comes in lower bound as per previous videos.. Sir plzz do rply.. I got stucked here

    • @shamparoy5394
      @shamparoy5394 5 лет назад

      @@abdul_bari so here I can use omega also or only oh and theta

    • @shamparoy5394
      @shamparoy5394 5 лет назад

      @@abdul_bari thnku soo much sir ur videos r really very helpful

  • @subhamdudheria9523
    @subhamdudheria9523 2 года назад

    shouldn't this be T(n/2)+2 , as if statement also takes 1 unit of time

  • @speak_charlie
    @speak_charlie 4 года назад +1

    IIIT dharwad pppl🙄 like karo

  • @monodeepbanerjee5427
    @monodeepbanerjee5427 4 года назад

    Time complexity of T(n) =2T(n)+n is 0(2^n) not 0(n2^n)as you have said

  • @amazepk
    @amazepk 5 лет назад +3

    Charan kaha hai prabhu ,Ek bar mere DAA ke teacher ko dikha aau sayad kuchh sikh le..

    • @amazepk
      @amazepk 5 лет назад

      @@abdul_bari jokes aside , thank you so much sir For putting Such an effort and making it free for us , saved my semester 🙏

  • @shobhitsrivastava8876
    @shobhitsrivastava8876 3 года назад

    T(n) = T(n/2) + log(n). Can I have an explanation for this?

  • @Adityasingh-nn5fe
    @Adityasingh-nn5fe 5 лет назад

    T(n)=2T(n/4)+3^1/2 sir i can't solve this question

  • @smrutiranjandas5466
    @smrutiranjandas5466 6 лет назад

    Plzzz solve my pblm and show me

  • @roohantariq706
    @roohantariq706 Год назад +1

    Sir agar meri koi behn hoti to mey apko deta shadi k liye

  • @Swansylinks
    @Swansylinks 4 месяца назад

    I am so so grateful for coming across your channel sir.. thank you so much for this comprehensive teaching ❤❤❤

  • @nouf5184
    @nouf5184 2 года назад

    Thank You !