JB TAK FODEGA NHI .... TB TK CHODEGA NHI .... (MAANG)

L6 Recursion on Subsequences

We Preveselly Learned the Multiple Recursion but the Question is where used the Concept of the Multiple Recursion
The stateforword ans is Subsecquance and Dynamic Programming

Subsecquances

Subsecquances Means follow the particular Order its cab be Contigeous or Non - Contigeous

  • Subarray: that is Contigeous Not Not Contigeous
  • Subsecquances: that is both Contigeous or Non - Contigeous

  • We have Array and print all the Subsecquances with Maintain the Order


    How Can we do this Problem
  • Now this Problem we have very popular Algorithm that is know as Power Set using the Algorithm we find all the Subsecquance of the Array.
  • But here we Soled this Question using the Recursion
  • We Solved this Quesion using Famush Algorithm Pick and Not Pick Concept



  • Sudo Code



    Recursion Tree


    Notes

    Note: Zoom for Better Understanding



    Code Zone!

    Recursion Python Code
    Recursion Java Code
    Recursion C++ Code
    Sb Mai He Kru ...

    Khud Bhi Kr le Khuch ..... Nalayk


    Time Complexity:O(2 ^ N) For every Iteration we have tuple of option take or not take Exponintial Time
    Space Complexity:O(N)+O(N) O(N) for the Recursive Stack Space and O(N) for Store the our element that is our Subsecquances.


    Color
    Background
    Interview Docs File "All the Best" Team @DSAwithPrinceSingh

    ~ It's All About Consistency📈 Dedication🎯 HardWork💪 Happy Coding❤️ ~