2.1.2 Recurrence Relation (T(n)= T(n-1) + n) #2

Sdílet
Vložit
  • čas přidán 22. 01. 2018
  • Recurrence Relation for Decreasing Function
    Example : T(n)= T(n-1) +n
    Courses on Udemy
    ================
    Java Programming
    www.udemy.com/course/java-se-...
    Data Structures using C and C++
    www.udemy.com/course/datastru...
    C++ Programming
    www.udemy.com/course/cpp-deep...

Komentáře • 342

  • @m7mdarwani964
    @m7mdarwani964 Před 2 lety +438

    For Calculus, we have Prof. Leonard & for Algorithms, we have teacher Abdul Bari. Thank God

    • @fritz6600
      @fritz6600 Před 2 lety +5

      Indeed. Haha.

    • @SwatejTech
      @SwatejTech Před 11 měsíci +3

      For linear algebra we have Gilbert Strang.

    • @shreya-tf5go
      @shreya-tf5go Před 11 měsíci

      🙂🙂

    • @cocaine4youu
      @cocaine4youu Před 8 měsíci +4

      Prof. Leonard saved my undergrad calculus!!!

    • @cancali
      @cancali Před 6 měsíci +1

      Do you have recommendations for Physics (1&2) and Circuit classes? I CANNOT deal with these..

  • @emelyloria7467
    @emelyloria7467 Před 5 lety +377

    Teaching is a talent!! You're one of the best teachers I've known. I should have found your channel before.

    • @wirito
      @wirito Před 4 lety +6

      I wish I had found this channel before I took algorithms. I would have aced everything :)

    • @user-wc1sm8cj8s
      @user-wc1sm8cj8s Před 3 lety

      mw too

  • @michaelekoka3263
    @michaelekoka3263 Před 5 lety +102

    Excellent teacher.
    As he said, adding the n gives 2n-1, 3n-2, etc, making the pattern a bit less obvious and the expression a bit more difficult to solve. But sometimes we have to live dangerously, so here we go:
    T(n) = T(n-1) + n
    T(n) = T(n-2) + 2n - 1
    T(n) = T(n-3) + 3n - 3
    T(n) = T(n-4) + 4n - 6
    ...
    T(n) = T(n-k) + kn - [(k-1) + (k-2) + ... + 3 + 2 + 1]
    Assuming n-k = 0; k = n
    T(n) = T(0) + n² - [(n-1) + (n-2) + ... + 3 + 2 + 1]
    Isolating the expression in brackets
    [(n-1) + (n-2) + ... + 2 + 1]
    We know that
    n + (n-1) + (n-2) + ... + 2 + 1 = n(n+1)/2
    Taking off n from both sides we get
    (n-1) + (n-2) + ... + 2 + 1 = (n(n+1)/2) - n
    which resolves to
    (n(n+1)/2) - 2n/2 => (n(n+1) - 2n)/2 => (n(n+1-2))/2 => n(n-1)/2
    Plugging it back in the equation in its new form
    T(n) = T(0) + n² - [n(n-1)/2]
    Removing the brackets and swapping the sign
    T(n) = T(0) + n² + n(1-n)/2
    T(n) = 1 + (2n² + n(1-n))/2
    T(n) = 1 + n(2n+1-n)/2
    T(n) = 1 + n(n+1)/2

    • @ajaypanthagani5959
      @ajaypanthagani5959 Před 5 lety +7

      its T(n) = T(n-3)+3n-3
      I think

    • @michaelekoka3263
      @michaelekoka3263 Před 5 lety +6

      ​@@ajaypanthagani5959 Sequence is indeed 1 3 6 10... Good catch, thanks!

    • @neru1091
      @neru1091 Před rokem

      I would like to ask, where did 2n^2 came from after removing and swapping the sign? did you just plugged in a constant c to get n(n+1)/2?

  • @amberpradhan2484
    @amberpradhan2484 Před 4 lety +31

    Hello Sir, You are the best teacher so far. God bless you and your family. Thank you for sharing your knowledge which is helping us a lot.

  • @sarfarazkhanbiradar544
    @sarfarazkhanbiradar544 Před 3 lety +6

    I have started admiring you Abdul !!! Wish every teacher/instructor be like you. Thank you

  • @Usertyspr
    @Usertyspr Před 2 lety +11

    Greatest teacher of Algorithms . Even my college teacher(dsa) first watchs your videos the he teaches us .....He completely try to copy but couldn't .

  • @coderopes2983
    @coderopes2983 Před 5 lety +59

    Study is beautiful with u sir✌️👍🏻✌️

  • @ravigupta4252
    @ravigupta4252 Před 4 lety +28

    Before finding your videos, I was very scared of CSE subjects but now I m becoming hero in algorithms 👍

  • @elitesquad8231
    @elitesquad8231 Před 3 lety +9

    Teaching is an ART and you are the ARTIST 🔥🔥🔥🔥

  • @icepurple6525
    @icepurple6525 Před 3 lety +14

    I have passed my data structures course by these lectures and now finally understanding algorithms. Thank you very much

  • @mohammedal-khulaifi7655
    @mohammedal-khulaifi7655 Před 3 lety +6

    best algorithm teacher in the world

  • @priyankamanna4550
    @priyankamanna4550 Před 3 lety +8

    Your teaching skill is super. I really understand each and every thing you taught and my concepts are really cleared out after watching this.. I hope you make more such video on programming concepts .😀

  • @erikadistefano7582
    @erikadistefano7582 Před 4 lety +3

    There should exist more people like you in the world! Thank you

  • @ryzurrin
    @ryzurrin Před 2 lety +6

    You good sir have just expanded my brain and my wisdom, thanks for the great lessons!

  • @mahimsd7645
    @mahimsd7645 Před 5 lety +5

    one of the best lecture on Algo... I HV ever listened........

  • @wirito
    @wirito Před 4 lety +21

    8:50 when you go to office hours and the professor has already explained it twice and you say: I still don’t get it professor.

  • @ishaqbhat800
    @ishaqbhat800 Před 3 lety +2

    The way u have delivered it..... really made it very easy to understand.that is the beauty lies in this lecture.

  • @noahsim9976
    @noahsim9976 Před rokem +1

    When you said "Hello friends" at the beginning, I couldn't help but smile.

  • @souravbhattacharyya8228

    You have a natural way to explain these things. Exceptional videos. Would like to learn OS or python, java from you. Thank you.

  • @edwintan4784
    @edwintan4784 Před 5 lety +2

    Sir, loves your videos! Finally i can understand Algorithms in a simple way. Please continue to create more videos! Hope u can cover every Advanced Algorithms as in Cormen’s textbook.Thanks!

  • @pedronieto1584
    @pedronieto1584 Před 5 měsíci +2

    Yessss this is just what I needed. Thank you Prof Bari!

  • @deepanshuchoudhary4598
    @deepanshuchoudhary4598 Před 4 lety +40

    I thought you would slap me :p :p @ 8:54

  • @SubodhKumar-pf6fn
    @SubodhKumar-pf6fn Před 5 lety +1

    Sir you are very accurate and to the point, and also I love to watch your videos as you are accurate with your way of teaching....

  • @alexpena9927
    @alexpena9927 Před 3 lety +3

    WOW three lectures I couldnt understand, then this guy comes along and I understand it in 3 minutes.

  • @africanhope1440
    @africanhope1440 Před 3 lety +1

    This is the best tutorial I have ever watch on youtube.

  • @dmike4real496
    @dmike4real496 Před 3 lety +5

    This man's breathtaking!

  • @RKNancy
    @RKNancy Před 5 lety +5

    Thank you sir. Your videos will help me pass this examination. Thank you hundred-fold.

  • @abhishek7969
    @abhishek7969 Před 6 lety +10

    learning a lot from ur videos

  • @anishkumargiri9490
    @anishkumargiri9490 Před 2 lety +1

    Sir the way you teach every concept get's clear.....thanks a lot sir you are making future of many students bright...keep going sir

  • @arrogantermistkerl4579
    @arrogantermistkerl4579 Před 5 lety +13

    He's staring that knowledge into my head

  • @loviisamaenpaa6452
    @loviisamaenpaa6452 Před 5 lety +24

    Thank you!! Finally I got this, thanks to you!

  • @y031962
    @y031962 Před 4 lety

    thank you so much for posting this and all you clips. I found them very useful.

  • @ParvezAlam-gt6cc
    @ParvezAlam-gt6cc Před 4 lety

    Sir you are awesome and teaching style is very good. Thanks for this video Sir. Now I can easily understand everything things about algorithm. Again thank you sir. May you live long and healthy.

  • @joynaew
    @joynaew Před 7 měsíci

    You deserve nothing but happiness and great things in your life! I cant thank you enough!

  • @poojabhale816
    @poojabhale816 Před 4 lety

    Thank you sir...tomorrow is our exam and your lectures are ssly a saviour for us.....it easily made us understand the concept one night before the exam....👍

  • @thesigma3779
    @thesigma3779 Před 6 měsíci

    sir you are best, with best explanation i got till now. i was never understanding these algorithms because nobody actually knew it completely and never explained them fully. so i always cramed them , which i never like😂. Thank you a lot for keeping and incresing my interest in programming😊.

  • @ankursahu7704
    @ankursahu7704 Před 6 lety +7

    Thank you sir
    You helped me a lot.

  • @rathnaprabuayyappan3117
    @rathnaprabuayyappan3117 Před 2 lety +4

    Teaching is an art and abdul sir ,you are an artist of it. Cool, calm and composed teaching!!!!

    • @_VIREN
      @_VIREN Před 10 měsíci

      kuch samjh nahi aaraha bro
      \

  • @bhaskargg6018
    @bhaskargg6018 Před 4 lety

    Your explanation is crystal clear, thanks a lot Sir for sharing your knowledge

  • @kengthe5949
    @kengthe5949 Před 4 lety +1

    the best explanation ever. Thank you!

  • @ashrafkhatib3355
    @ashrafkhatib3355 Před 4 lety +1

    You are amazing my friend a huge thank you!

  • @oskarf8868
    @oskarf8868 Před 2 měsíci

    I appreciated the video a lot, thanks from Poland

  • @jagjotsingh2039
    @jagjotsingh2039 Před 5 lety +9

    Oakland University Sent Me Here

  • @all-roundersanyal4472
    @all-roundersanyal4472 Před 4 lety

    Sir ,,,you are great ,I love the way you teach. It is so clear.Thanks a lot sir.NPTEL teachers are so boring ,,,,,,but you are interesting with your subject.

  • @sxd723
    @sxd723 Před 5 lety

    Thank you! This video helped me a lot!

  • @subhankarkanrar9494
    @subhankarkanrar9494 Před 4 měsíci

    Huge respect
    To Bari sir, for deep knowledge.

  • @rahulsathyan5772
    @rahulsathyan5772 Před 6 lety +2

    Life Saver.....
    Thank you Sir.

  • @techzung
    @techzung Před 5 lety

    God bless you sir... you are a great teacher...

  • @superwendel
    @superwendel Před 5 lety +1

    Blessed Explanation !

  • @AdityaPandey-rt5ez
    @AdityaPandey-rt5ez Před 5 lety

    love you sir ! great explanation

  • @AbhinayKacham
    @AbhinayKacham Před 4 lety

    That was indeed simple. Thank you

  • @cmpala6838
    @cmpala6838 Před 5 lety

    Nice video continue you are the best

  • @preetsutariya1664
    @preetsutariya1664 Před 4 lety +2

    ENLIGHTENING 🙏💯🔥

  • @DavidLopez-eb5km
    @DavidLopez-eb5km Před 2 lety

    Nicely Explained Professor!

  • @kayalvizhikalaichelvan5283

    Very Useful Series Sir. Thank you

  • @maninderkaur6664
    @maninderkaur6664 Před 5 lety

    best teacher ever:-)

  • @AnujKumar-tt5md
    @AnujKumar-tt5md Před 4 lety +2

    Sir... You are a gem 💎 among teachers. Thanks🙏

  • @solomonobino7980
    @solomonobino7980 Před rokem +1

    This guy good for real..😁

  • @Stoic_Cat_
    @Stoic_Cat_ Před 5 lety +2

    Thank you so much sir you have helped me alot

  • @dg3577
    @dg3577 Před rokem +1

    really awesome explanation sir all software engineers

  • @advikasingh739
    @advikasingh739 Před 2 lety

    thanks sir ur videos are so good really understood the concept

  • @iAmShortyFry
    @iAmShortyFry Před 3 lety +1

    Thanks for helping me obtain my degree :)

  • @shreemaan-abhishek
    @shreemaan-abhishek Před 3 lety +4

    Here he is! The man, the myth, the legend!

  • @wasay8105
    @wasay8105 Před 2 lety

    you're really good at teaching

  • @AbdallahSayed-hp4hw
    @AbdallahSayed-hp4hw Před rokem +1

    thank you very much you help me to understand this, you are a legend

  • @kartech4592
    @kartech4592 Před 2 lety

    All colleges that teach data structures should fire their hopeless lecturers and just play this video. Immense respect for Abdul Bari

  • @vmidhun8973
    @vmidhun8973 Před 3 lety

    Best lectures on Algorithms.

  • @user-rh4fc4nm3l
    @user-rh4fc4nm3l Před 4 lety

    جزاكَ الله خيرًا

  • @r.prasannavenkatesan9879

    Thanks a lot sir, loads of respect

  • @ChauDang-bm1nf
    @ChauDang-bm1nf Před 4 měsíci

    Please make videos of computer architecture. You’re teaching skills is brilliant.

  • @kingdeath1007
    @kingdeath1007 Před 4 lety +17

    Recursive Tree Method 3:24
    Substitution Method 7:47
    note 1 9:16-9:49
    note 2 13:39-13:48

  • @arnoc.2107
    @arnoc.2107 Před 5 lety +1

    love the random stares into the camera like at 8:48 :P

  • @sadeghhosseini6381
    @sadeghhosseini6381 Před 2 lety +2

    Please continue publishing new tutorials on other CS courses like OS and etc. You are one of the best teachers i've ever seen.

  • @justinpower4475
    @justinpower4475 Před 4 lety +1

    Abdul Bari for President

  • @muhammadnaeem9855
    @muhammadnaeem9855 Před 5 lety +1

    Good to the the point lectures with such simplicity and examples... Amazing. may ALLAH bless you.

  • @lollol-or4yj
    @lollol-or4yj Před 4 lety

    you are amazing sir , tysm

  • @AbhishekYadav-wc5vz
    @AbhishekYadav-wc5vz Před 4 lety +4

    14:13 Itna solve krne ke baad... Mahaul badal gya, zazbaat badal gye ;)

  • @susmithashanmugam8226
    @susmithashanmugam8226 Před 4 lety +1

    Sir please upload more videos about data structures sir it is very useful

  • @Insaanbansalman
    @Insaanbansalman Před rokem

    Thanks Abdul Bari!

  • @vakhariyajay2224
    @vakhariyajay2224 Před 2 lety +1

    Thank you very much. You are a genius.

  • @BryceChudomelka
    @BryceChudomelka Před 3 lety +4

    Hello Friends!

  • @siddharth_singhvlogs
    @siddharth_singhvlogs Před 4 lety +1

    Kash mere class teacher bhi daa in sir ke jaise padha pate🤔🤗

  • @codetogether24x7
    @codetogether24x7 Před 3 lety +1

    yes sir you teaching method is very good

  • @lensam5288
    @lensam5288 Před 2 lety +1

    God bless you! you made my life easy!!!!!

  • @user-vd3vz9vo1m
    @user-vd3vz9vo1m Před měsícem

    best teacher ever

  • @roshnisharma281
    @roshnisharma281 Před 6 lety +2

    Sir your lectures are very helpful for us.
    Thank you sir

    • @duchuynh9019
      @duchuynh9019 Před 5 lety

      Roshni sharma nhạc hen ha chenhacchepp

  • @techexplored
    @techexplored Před rokem

    I really initially thought that the answer should be O(n) as there is one for loop. I was clearly wrong. Thank you sir for explaining this soo elegantly and making us better students

  • @mariarex2799
    @mariarex2799 Před rokem

    Nice explanation sir !

  • @tictacricrac
    @tictacricrac Před 4 měsíci +1

    In fields where legends freely roam,
    A GOAT emerges, to claim its throne.
    With prowess unmatched, it scales the height,
    In realms of glory, it takes its flight.
    In games of skill, it reigns supreme,
    The GOAT, a champion in every scheme.
    With grace and power, it dominates,
    In history's annals, it seals its fate.
    Through trials faced and challenges met,
    The GOAT's legacy, we won't forget.
    In every triumph, it leaves its mark,
    A symbol of greatness, shining stark.
    Oh, GOAT, in realms of fame you dwell,
    Your spirit shines, a timeless spell.
    In every field, your legend's told,
    Greatest Of All Time, forever bold.

  • @DenisGitonga
    @DenisGitonga Před 2 lety

    Excellent Teacher...

  • @shemsusultan7987
    @shemsusultan7987 Před 2 lety

    you are teaching in nice way

  • @shanealam3246
    @shanealam3246 Před 4 lety

    very useful lectures
    Thanks sir

  • @SRNR_PODCAST.
    @SRNR_PODCAST. Před 3 lety +1

    a gold mine in youtube

  • @edwintan4784
    @edwintan4784 Před 5 lety

    Excellent teaching

  • @Ravi-jp3lu
    @Ravi-jp3lu Před 4 lety +1

    sir can we construct recurrence tree for the given recurrence relation without algorithm(void test(n))??

  • @arindamroy7671
    @arindamroy7671 Před 6 lety +4

    A probable rectification - Since T(0) is never written as 0 as instructed by you in the previous video , T(0) in the execution depiction should be equal to 1not 0. So it should be 1+2+3+......+ n-1+n = n(n-1)/2 .

  • @devanshkhare3532
    @devanshkhare3532 Před 4 lety +9

    Sir, ar 5:51 you took T(0) will take 0 time. But you also said that 0 time means constant time so we take 1 instead of 0.
    So, for summing up, if taken 1 instead of 0 sum should be = n(n+1)/2 +1 .
    I know it wont make a difference in the final answer but just wanted to confirm if I am theoritically correct or not ?
    Please do reply and Thank you in advance !

  • @dg3577
    @dg3577 Před rokem

    fantastic explanation sir

  • @md.moshiurrahman44
    @md.moshiurrahman44 Před 5 lety +35

    8:49
    :P :P

  • @aradhyajain9575
    @aradhyajain9575 Před 6 lety +4

    Sir please....upload a video on PROPERTIES OF ASYMPTOTIC NOTATIONS and how they are used....lately i have beem getting confused on that topic...sir please it will be very helpful for us in GATE examination.