G-6. Depth-First Search (DFS) | C++ and Java | Traversal Technique in Graphs

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

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

  • @takeUforward
    @takeUforward  2 года назад +83

    Let's continue the habit of commenting “understood” if you got the entire video.
    Do follow me on Instagram: striver_79

  • @jeet-smokey
    @jeet-smokey Год назад +45

    Entire Semester you taught in these 56 videos. Kudos to your efforts...!!!!! Keep growing.

  • @Ace-ex9gg
    @Ace-ex9gg Год назад +51

    I was 5.27 minutes into the video and i initially thought that dfs would use recursion when you started explaining about going back and front. The moment you told recursion i stopped the video and started to code my own recursion algorithm. And i figured it out and got output. Im complete honest here . I myself came up with my algorithm and it worked in first attemt itself. All thanks to strivers recursion playlist.
    my code
    public static void depthsearch(ArrayListal,int[] vis,Queue qu,int node)
    {
    for(int a:al.get(node))
    {
    if(vis[a]==1)continue;
    vis[a]=1;
    qu.add(a);
    depthsearch(al,vis,qu,a);
    }
    return;
    }

    • @SohailKhan-cx9gb
      @SohailKhan-cx9gb 10 месяцев назад

      Bro i have a doubt whts the use of list and why we take it vectorls?

    • @jha.brajesh
      @jha.brajesh 9 месяцев назад

      @@SohailKhan-cx9gb vector is for c++, and list is for Java

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

      what's your codeforces rating?

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

      Yhi cheej me saari visited nodes hoenge​@@SohailKhan-cx9gb

    • @AdityaMaurya-dw3od
      @AdityaMaurya-dw3od 4 месяца назад

      I did it too!! Striver's recursion playlist has indeed made me good at it!

  • @shristyjoshitk
    @shristyjoshitk 2 года назад +45

    Striver bhaiya ki jai...far far far better explaination than that of College professor ⚡🙌

  • @anandverma2714
    @anandverma2714 3 месяца назад +2

    00:04 Learn about depth-first search (DFS) in graphs.
    02:23 Depth-First Search (DFS) is about traversing in depth
    04:26 DFS explores in depth, uses recursion.
    06:47 Explanation of Depth-First Search (DFS)
    09:04 DFS traversal explores graph depth-wise and avoids revisiting visited nodes.
    11:18 Depth-First Search (DFS) traversal technique in graphs.
    13:25 DFS technique explained using adjacency list in graphs
    15:35 Depth-First Search (DFS) traversal technique in graphs.
    17:44 DFS traversal iterates on node neighbors and calls function once per node.
    19:36 The time and space complexity depend on the number of edges.
    Crafted by Merlin AI.

  • @itenigneer21
    @itenigneer21 4 дня назад

    The passion with which you teach is commendable !!

  • @cinime
    @cinime 2 года назад +10

    Understood! Amazing explanation as always, thank you very much!!

  • @codewithvidhi
    @codewithvidhi 2 года назад +24

    Pointing a mistake, at 12:36 you removed 3 from the final dfs traversal list and it stays like that till the end. Which is incorrect.

  • @ShubhamKumar-km8pm
    @ShubhamKumar-km8pm 2 года назад +12

    Thanks striver for such an amazing explanation of the recursive tree.

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

      Can you tell me why here not mentioned base condition

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

      ​@@kavyabanka4482 We are just visiting each node and adding it to an array list. And if for a particular node, there are no neighbours, then we are not calling the function again.
      So we just need to return the updated list back for each recursive call

  • @raghvendrakhatri5848
    @raghvendrakhatri5848 2 года назад +17

    Understood each and every word♥. Kudos to your hard work and dedication, you are the motivation behind a lot of people. Your hardwork inspires a lot of people to work hard.
    Thankyou for providing such a beautiful graph series keep posting such content ♥, we all need this.

  • @sumeetubale3923
    @sumeetubale3923 Год назад +4

    Best video tuturials on the you tube absolutely!!!

  • @swaeato672
    @swaeato672 20 дней назад

    Your explanation and efforts you put in every video are beyond words to express the gratitude, God bless you

  • @c.ramanji2604
    @c.ramanji2604 2 года назад +5

    the best playList on graphs i ever see..Thank you so much 😊😍

  • @DevanshuAugusty
    @DevanshuAugusty Год назад +5

    instead of "int vis[v] = {0}" we can also use "vector vis(v)" right?

    • @ayushsenapati8420
      @ayushsenapati8420 Год назад +6

      You can write "vector vis(v,0)"

    • @DevanshuAugusty
      @DevanshuAugusty Год назад +4

      @@ayushsenapati8420 vector vis(v) would also work. as default values will all be 0

    • @gouravp.3851
      @gouravp.3851 2 месяца назад

      it's just more intuitive to use normal array

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

    UNDERSTOOD!!!!!!!!!!!!!!!!!!!!!!!!!

  • @parthib_deb23
    @parthib_deb23 3 месяца назад

    I thought before coming to this video , you have explained topics like spanning forests and how its different from spanning tree and how peeps can relate tree-traversals with graph-traversals (relate doesn't means same !!). But you have just straight hopped on algorithms and code 🙂. Good , Carry on😀

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

    Understood! Amazing explanation

  • @shaddyrogue9430
    @shaddyrogue9430 2 года назад +10

    Should not we have a for loop in the top if we have unconnected components?

    • @takeUforward
      @takeUforward  2 года назад +13

      Yes, you should. But this one was a single component graph. So not needed.

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

      @@takeUforward Ok got it thanks. Understood.

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

      can you give the code which will work for unconnected components also ?
      Or can u just explain the logic ?

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

      @@takeUforward Is the below code correct for unconnected components also ?
      void dfs(vector&visited, int node, vector&ans, vector adj[]){
      visited[node]=1;
      ans.push_back(node);
      for(auto it:adj[node]){
      if(visited[it]==0){
      dfs(visited,it,ans,adj);
      }
      }
      }
      vector dfsOfGraph(int V, vector adj[]) {
      // Code here
      vectorans;
      vectorvisited(10000);
      for(int i=0; i

  • @AkshatTambi
    @AkshatTambi 7 месяцев назад +8

    if anyone wants an iterative approach here it is->
    class Solution
    {
    public:
    vector dfsOfGraph(int V, vector adj[])
    {
    stackstk;
    vectorvisited(V,0), dfs;
    stk.push(0);
    while(!stk.empty())
    {
    int temp=stk.top();
    stk.pop();
    if(!visited[temp])
    {
    visited[temp]=1;
    dfs.push_back(temp);
    //as the nodes in the adj list are given in order of left to right
    //so push right to left so that we can pop left to right, to maintain order
    for(int i=adj[temp].size()-1; i>=0; i--)
    {
    int t=adj[temp][i];
    if(!visited[t]) stk.push(t);
    }
    }
    }
    return dfs;
    }
    };

    • @vipuljha7305
      @vipuljha7305 7 месяцев назад +1

      compilation error is there in ur code and it is for bfs, not dfs

    • @AkshatTambi-sd1qg
      @AkshatTambi-sd1qg 7 месяцев назад

      It is ac on gfg and. It is indeed for dfs, notice the data structure used

    • @ashtonronald
      @ashtonronald 5 месяцев назад

      i can confirm akshat's method is logical & correct

    • @VEDANSHSHARMA-o6k
      @VEDANSHSHARMA-o6k 5 месяцев назад

      arre hello bhai

    • @AkshatTambi
      @AkshatTambi 5 месяцев назад

      @@VEDANSHSHARMA-o6k are bhai hello

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

    striver op...explanation op....... graph series SUperrrrrrr OP

  • @ravikant8609
    @ravikant8609 2 года назад +5

    great and amazing work! Loving it, thanks a lot❤

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

    Please make a videos on number theory

  • @swarajlahiri
    @swarajlahiri 9 месяцев назад +3

    Can a stack based solution be made for tha same DFS?

  • @umeshkaushik710
    @umeshkaushik710 2 года назад +5

    Amazing explanation as always.

  • @palak443
    @palak443 Год назад +2

    In java code why have we taken the size of visited array as v+1 when graph nodes are zero indexed

  • @amansingh.h716
    @amansingh.h716 Год назад +1

    lol mena 0.5 pa dekh lia puri video too funny .
    nice video bro

  • @aryashjain7893
    @aryashjain7893 2 года назад +8

    understood almost , but why is the vis array is not accessed by & sign as we need the values of it, or are arrays refrenced directly , and for vectors we need a '&'

    • @sumerrawat6947
      @sumerrawat6947 2 года назад +17

      arrays are always passed by reference , when we pass an array as a parameter to a function , the pointer to the first element of the array is passed , so any changes in the array inside external function will reflect in the main function, or the changes made in the array remains !
      but for vector we need to specifically pass by reference to avoid making a copy of it

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

      @@sumerrawat6947 i have the same doubt about the reference . thanks to you .

    • @ASHUTOSHSHARMA-us6hd
      @ASHUTOSHSHARMA-us6hd 5 месяцев назад

      @@sumerrawat6947 copy thodi banegi, reference bola haina, same memory address par hi saare changes hoge array mai

  • @priyagupta6999
    @priyagupta6999 Год назад +14

    I am bit confused, on why the time complexity if added as O(n) + O(2*E) instead it should be multiplied right ? We are calling for all the nodes once and for each each we are calling all its neighbours no of time. i.e. O(n*2*E) ~ O(nE) . Please help me understand.

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

      I too have the same doubt

    • @mdshaqlain3252
      @mdshaqlain3252 Год назад

      @@suchetapal713 Did u understand??

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

      The comment section in the BFS video contains a great explanation by @YeaOhYeahh. Should help.

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

      that O(2*E) is kind of the summation over all those inner for loops , striver has explained that check out the bfs video

    • @Mr_X_FIFA
      @Mr_X_FIFA 6 месяцев назад +4

      For each value from 0 -> n we are not visiting 2*E nodes.....we are visiting 2*E nodes in total for all n...not for each for i in 1 to n..... that's why time complexity is O(n + 2*E)

  • @rahulsinghshekhawat2487
    @rahulsinghshekhawat2487 Год назад +4

    Thank you very much. Great explanation.

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

    Completely UNDERSTOOD.

  • @Abcd-jt1qs
    @Abcd-jt1qs 7 месяцев назад

    Understood Striver!! Thank you so so much for these amazing lectures :)

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

    understood each and every bit of your explanation...

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

    i am using vectorvis(V,0) than only three test cases are passing

    • @himshikharsingh9010
      @himshikharsingh9010 5 месяцев назад

      you need to pass it by reference, as you don't wanna send a copy of the vector every time dfs is called, and rather the original vis vector needs to be manipulated, hence, you need to pass it by reference

  • @crazybro4383
    @crazybro4383 Месяц назад

    Thank you "goat" for these amazing lectures

  • @supriyakeshri78
    @supriyakeshri78 5 месяцев назад

    best series on Graph👍

  • @1LineCode
    @1LineCode 2 месяца назад +1

    I think for the undirected graph the time complexity should be TC-> O(N)*O(2E) i.e for each node visit you have to cheak all of its neibours so TC -> O(2*N*E)

    • @aryanagrawal9103
      @aryanagrawal9103 2 месяца назад +1

      2E is the total number of degrees, not the number of degrees of each node. So it will be O(N) + O (2E)

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

    I have an interview tomorrow for a good hefty package and I feel pretty confident . I really don't know what is going to happen tomorrow but I hope I come back with some thing good . Just putting this comment up to see if this would be a great memory or a don't know what 💕💕

    • @aishuladha6911
      @aishuladha6911 4 месяца назад +1

      How's your interview

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

      @@aishuladha6911 did not go well . I was able to answer all questions almost right but not 100% right . In the end they ended up taking 2 students who I guess might were able to answer 100% right

  • @it.b.61.prashantsingh87
    @it.b.61.prashantsingh87 Год назад

    At 2:44, we push 4 and 7 into the stack after removing 3, now 7 traverse and check for neighbor node 8, it pushes that into stack, 4 was already visited so 8 will simply get pop and will not push anything.... Corrct me if I'm wrong

  • @girishbhargava6367
    @girishbhargava6367 2 года назад +6

    In the interviews, can we be sure, that we would be given adjacency lists, or we can be given adjacency matrix also?

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

    Thank you, Striver 🙂

  • @priyamagarwal3469
    @priyamagarwal3469 Год назад +3

    Can we not use stack method, if so please provide the code for it

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

    Understood each and every word♥

  • @poulamisaha1506
    @poulamisaha1506 2 года назад +5

    Hi, the node 3 was traversed but not added to the visited array. Please correct me if I am wrong

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

      you are right, hi missed writing it by mistake

  • @sagaravhad5198
    @sagaravhad5198 Год назад

    your contribution is matchless. thank you.

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

    14:03 You forgot to mention 3 in DFS call. It should ve 1,2,5,6,3,7,8,4

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

    you have not discussed it for non connected components . btw nice explaination

    • @SlapB0X
      @SlapB0X Год назад

      im not sure but can we traverse to a node if its not even connected to the parent node?

    • @The_Shubham_Soni
      @The_Shubham_Soni Год назад

      Visited does that work

  • @siddharthkardam321
    @siddharthkardam321 Год назад

    you r god of coding

  • @stith_pragya
    @stith_pragya Год назад

    Thank You So Much for this wonderful video...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

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

    Awesome work, thank you!

  • @aryanshah4536
    @aryanshah4536 9 дней назад

    why do we need to make vis[0]=1?? when the nodes are 1 based indexing and why do we need vis[n+1] when using 1 based indexing?

  • @hashcodez757
    @hashcodez757 5 месяцев назад

    "UNDERSTOOD BHAIYA!!"

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

    understood bro, love from bangladesh.

  • @RAJPATEL-ir7ly
    @RAJPATEL-ir7ly 8 месяцев назад

    we should use for loop in main ic case of non-connected components right?

  • @psionl0
    @psionl0 Год назад +3

    I would have liked to see the code for a DFS using a stack rather than recursion. It is more intuitive. It makes DFS and BFS almost identical except that DFS uses a stack and BFS uses a queue.

    • @Raju_Sharma852
      @Raju_Sharma852 Год назад +2

      Hii bro
      vector dfsOfGraph(int V, vector adj[]) {
      vectorans, visited(V, 0);
      stacks;
      s.push(0);
      while(!s.empty()){
      int ele = s.top();
      s.pop();
      if(!visited[ele]){
      ans.push_back(ele);
      visited[ele] = 1;
      }
      for(int i = adj[ele].size() - 1; i >= 0; i--){
      if(!visited[adj[ele][i]]){
      s.push(adj[ele][i]);
      }
      }
      }
      return ans;

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

      @@Raju_Sharma852 I know how to code it. I just thought it would be useful for other viewers to see it done in this video.

  • @ramanpareek5218
    @ramanpareek5218 6 месяцев назад

    Liked the video, notes taken, understood

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

    I have a doubt in this code of yours what if in a graph I give you two components you can traverse with only one component but for the other one this code will fail.
    Now, to answer which will be the right code so in Striver bhaiya old series he explained that code which will run for every graph doesn't matter how many components you have.

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

      I have the same doubt , if more than one disconnected components.
      I am running the loop for all the nodes if there are disconnected components and passing visited array as reference then it giving me an error don't know why .
      have you any idea why it is giving me an error while passing the reference of visited array . ???

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

      @@jiteshjoshisde3154 share me the code in which you are facing error I will help you out.

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

      //I think this code will work for unconnected components also
      void dfs(vector&visited, int node, vector&ans, vector adj[]){
      visited[node]=1;
      ans.push_back(node);
      for(auto it:adj[node]){
      if(visited[it]==0){
      dfs(visited,it,ans,adj);
      }
      }
      }
      vector dfsOfGraph(int V, vector adj[]) {
      // Code here
      vectorans;
      vectorvisited(10000);
      for(int i=0; i

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

      @@amansinghal4663 for this u have to go from starting node to last vertix I actually use python see the code
      def dfsOfGraph(self, V, adj):
      # code here
      ans=[]
      visited=[False]*V
      for i in range(V):
      if visited[i] is False:
      self.dfshelper(i,visited,adj,ans)
      return ans
      def dfshelper(self,SN,visited,adj,ans):
      visited[SN]=True
      ans.append(SN)
      for i in adj[SN]:
      if visited[i] is False:
      self.dfshelper(i,visited,adj,ans) #It will work

  • @yashshukla1637
    @yashshukla1637 Месяц назад

    Thank you so much! just finished it

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

    Thank you very much. You are a genius.

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

    Great Explaination

  • @santhikumar-em8ts
    @santhikumar-em8ts Месяц назад

    mawa super explanation
    thaggedhe le

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

    Understood Sir, Thank you very much

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

    Why the visited array size is plus 1 ? In BFS also you have taken plus one size

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

    great lecture bhai

  • @pratyushsahoo4948
    @pratyushsahoo4948 11 месяцев назад

    Awesome work 👍

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

    is it mandatory in graphs that we have nodes numbered like 1,2,3.... or can we use it like 2 ,5,9 something like that

  • @jaykaantshikre751
    @jaykaantshikre751 Год назад

    Understood and rewatched to revise

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

    Wouldn't this only work for connected graph? what would happen if there are multiple different connected components ?

    • @KdStatusKing
      @KdStatusKing 11 месяцев назад +1

      Then you will have to declare visited array of type of vector and pass it by reference to DFS func and then run a loop in your main function for non-visited nodes.

    • @shashamnk2525
      @shashamnk2525 11 месяцев назад +1

      @@KdStatusKing got it, thank you.

  • @paullater6230
    @paullater6230 8 месяцев назад

    Understood beautifully!!!

  • @jivanmainali1742
    @jivanmainali1742 5 месяцев назад

    for each node we are going through their adjacent node which is degree and sum of all degree is 2E so isnt time complexity is O(2E)=O(E),am i missing something?
    if we have outer loop going 1 through n and in each iteration inner loop goes for 1 throguh i . so time complexity is 1 + 2 + 3 + n = O(n2) . why similar thing not happening??

  • @Satya-g5t
    @Satya-g5t 3 месяца назад

    Understood. Also, nice explanation.

  • @kaichang8186
    @kaichang8186 5 месяцев назад

    understood, perfect explanation

  • @bhavkushwaha
    @bhavkushwaha 6 месяцев назад

    Thankyou Striver, Understood!

  • @AdrijaDuttaRoy
    @AdrijaDuttaRoy 7 месяцев назад +1

    A very silly question but still it keeps bugging me that why the time complexity is O(N + 2E) and not O(N*2E) as for each node we are checking all the edges . If anyone can clear my doubt it will be very helpful for me. Thanks in advance.

  • @Musicuvakavi1823
    @Musicuvakavi1823 5 месяцев назад

    Thanks... I solved this by myself...

  • @ShivamSingh-io2ui
    @ShivamSingh-io2ui 28 дней назад

    Will no return statement in the void function not cause a problem?

    • @yashrajjhanitian
      @yashrajjhanitian 21 день назад

      nope,it's not necesaary to return something in void function( )

  • @AppaniMadhavi
    @AppaniMadhavi 8 месяцев назад

    superb explanation

  • @bageshwardham-1M
    @bageshwardham-1M Год назад +2

    time complexity is O(N +2E) or O(N)+O(2E)??????

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

      both means same 🙂

    • @bageshwardham-1M
      @bageshwardham-1M Год назад

      @@anshumaan1024 arre haaannnn..idk why i asked such a silly doubt😶

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

      @@bageshwardham-1M it hapuns 🙃

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

    Understood 😌

  • @shreyjagtap1324
    @shreyjagtap1324 27 дней назад

    what is the base condition

  • @ashwanisingh8354
    @ashwanisingh8354 Год назад

    there is some error with dfs travel: 1256487 , you forgot to write mark 3 as visited. overall its amazing, just watching it again to revise it, sorry if was rude.

  • @AryanGairola-th3qc
    @AryanGairola-th3qc 9 месяцев назад

    great explanation bhaiya but you forget 3 to werite in ans

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

    Understood ❤

  • @amitsahoo3029
    @amitsahoo3029 Год назад

    in the dfs traversal node 3 is missing

  • @AjayYadav-xi9sj
    @AjayYadav-xi9sj 2 года назад

    When will all the videos be completed

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

    Why we are not using Stack here instead of recursion.Kindly guide Anyone.

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

      stack also uses recursion , and recursion make use of stack so both are just same.

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

      recursion uses Call Stack which is nothing but a stack provided in order to handle function callings
      so it is upto you that either you use your own Explicit stack or implicit stack ( i.e. Recursion or Call STack)

  • @samuelfrank1369
    @samuelfrank1369 Год назад

    Understood. Thanks a lot.

  • @GoUrAvpandey-g7r
    @GoUrAvpandey-g7r 8 месяцев назад

    thanks so much it was very helpful

  • @sara.rita.k
    @sara.rita.k Год назад

    if for each vertex, DFS visits all its adjacent vertices ..shouldn't time complexity be V*E ?

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

      All the adjacent vertices will surely be visited for all nodes, but as it is an undirected graph that mean if an edge exists from 1 to 2 then that same edge will also be checked as an edge from 2 to 1 , so we are checking an edge 2 times so it adds to the time complexity.

  • @amansingh.h716
    @amansingh.h716 Год назад

    can a graph contain similar nodes

  • @shreyxnsh.14
    @shreyxnsh.14 2 месяца назад

    Use V (for vertex) instead of N to remember better, N is ambiguous

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

    Dfs vs Bfs which one should we use while solving question

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

      you will automatically understand it by yourself,the more you practice.

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

    understood sir👍👍

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

    Hello bhaiya
    I will be starting my college 2-3 months later since jee advanced is this month end ...... Can you make a video on what we can explore in first year of college

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

      if you didn't qualify for the exam then he will help you

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

      @@abhijeettripathi7615 are you talking about jee?
      I did qualify it with 98.6 percentile..rank-11876 ....maybe I will get a decent Nit with ece branch .....just wanted to learn about coding and stuff before starting college

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

      ​@@siddhantmishra5659 c++ with dsa ,thodi competitive coding bhi karlo
      ,full stack web development seekhlo

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

    understood, thanks!

  • @Rieshu-l9i
    @Rieshu-l9i 9 месяцев назад

    #Striver rocks🤟

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

    why adj and vis are not passed by reference ? it is giving me error. we need to store there values in different function passes while recursion goes on naa

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

      arrays are always passed by reference , when we pass an array as a parameter to a function , the pointer to the first element of the array is passed , so any changes in the array inside external function will reflect in the main function, or the changes made in the array remains !

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

      @@amansinghal4663 thanks got it! and vectors are not always passed by reference ? right

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

      @@prathmeshmodhe6330 Yes, vectors are not passed by reference automatically. You have to manually do it by using the "&" symbol.

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

    understood striver!!!

  • @thicamtiennguyen3913
    @thicamtiennguyen3913 5 месяцев назад

    what app do you drawing?

  • @priyadarshinibardhan8058
    @priyadarshinibardhan8058 6 месяцев назад

    Errors n not declared + vector has no member named push

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

    understood..and liked