Hi bro! I am really surprised why there are less subscribers here! Your explanation is very clear and illustration is also very good. Other sites have poor explanation but more subscribers. Hope you reach more audience soon! All the best. You made graphs super easy for me. Thank you.
@@nikoo28 Hi Nikhil, The only thing missing in your list is separate playlist. I have been following you from last 2 years, Your videos are random. If you can just make playlist of each topic and that works. With such top explanation , I guess you just need that.
When you pop 3 (at 13:12) then you should be checking to append 2, 2 is not visited, so it would theoretically go on your stack again [2, 2]. Right? Does this mean that when you go to pop it from the stack and add it to the set you Should be checking if the node is already in the set?
From my thinking, we don't know how many vertices are there in the graph, in order to use arrays we need to specify the size of the array during the initialization. That is the reason we use Set instead of arrays, also Set doesn't allow duplicates.
@@nikoo28 but your elements are integers and if you have boolean[] visitedNodes , the indices of the array could be the elements, so checking if a node is visited would be if (!visitedNodes[a]) {} where a is the element.... this will also be a O(1) operation.
Hi bro, your really awesome in explaining solutions very understandable, keep doing brother. I have one question that was asked in coding round which I can't solve, could you please make one video regarding explaining the solution of it. Question -> swap all characters inside every prefect paranthesis. I/P = ( abcd) O/P =( dcba ), I/P = ( a(bc)d ) O/P = (d(bc)a), I/P = (a(b(cd)e)f) O/P =(f (b (dc) e) a).
we have to start swapping it from inside out, I/P = ( a(bc)d ) O/P = (d(bc)a) -> Explaination -> (bc) is first inside perfect parathesis swap it and it beomes (cb), and now a(cb)d it was also in perfect paranthesis swap it again and it becomes (d(bc)a).
Hi , when we code iterate version should'nt we add this before print it out. if (visited.contains(currentVertex)) continue; Because we get duplicate. You mention in theory but neglect it in code . Am i wrong? Great explanation btw. keep it up love your videos , really helpful, i learnt a lot from you
Hi bro! I am really surprised why there are less subscribers here! Your explanation is very clear and illustration is also very good. Other sites have poor explanation but more subscribers. Hope you reach more audience soon! All the best.
You made graphs super easy for me. Thank you.
Working a lot on it, to get search results at top. You can also help by sharing as much as possible :)
@@nikoo28 Hi Nikhil, The only thing missing in your list is separate playlist. I have been following you from last 2 years, Your videos are random. If you can just make playlist of each topic and that works. With such top explanation , I guess you just need that.
You are simply super Nikhil. You make things so simple and easy to understand, no matter how complex the topic is. 👍
Amazing Explanation Nikhil. Very clear and not confusing at all. Appreciate all your hard work!
Nikhil, you are my #1 favorite programmer on TH-cam. I love your lessons! I'm so excited to review your graph data structure series!
it is now complete. Did you have a look? :D
@@nikoo28 Hey! Congrats. I'm just starting the series, will definitely see how it goes, thanks for the help so far with all your other videos!
Thank you for the amazing detailed explanation!
I like it when you said 'iterative version is better', even I like iterative better anyday 😀
When you pop 3 (at 13:12) then you should be checking to append 2, 2 is not visited, so it would theoretically go on your stack again [2, 2]. Right?
Does this mean that when you go to pop it from the stack and add it to the set you Should be checking if the node is already in the set?
Great explanation, I'd love to know where the adjacency list was defined in the program. Many thanks
It's great explanation
Helped a lot 👍🏻
Pushing the algorithm
Why can't you use queue instead of stack?
why not use an array for visited ?
From my thinking, we don't know how many vertices are there in the graph, in order to use arrays we need to specify the size of the array during the initialization. That is the reason we use Set instead of arrays, also Set doesn't allow duplicates.
if you are using arrays, then checking if an element is visited will be a O(n) operation. A set gives you time complexity of O(1). So it is faster.
@@nikoo28 but your elements are integers and if you have boolean[] visitedNodes , the indices of the array could be the elements, so checking if a node is visited would be if (!visitedNodes[a]) {} where a is the element.... this will also be a O(1) operation.
@@srinivas1694 but in this case when creating a graph you need to specify the numberOfVertices
Hi bro, your really awesome in explaining solutions very understandable, keep doing brother. I have one question that was asked in coding round which I can't solve, could you please make one video regarding explaining the solution of it. Question -> swap all characters inside every prefect paranthesis. I/P = ( abcd) O/P =( dcba ), I/P = ( a(bc)d ) O/P = (d(bc)a), I/P = (a(b(cd)e)f) O/P =(f (b (dc) e) a).
we have to start swapping it from inside out, I/P = ( a(bc)d ) O/P = (d(bc)a) -> Explaination -> (bc) is first inside perfect parathesis swap it and it beomes (cb), and now a(cb)d it was also in perfect paranthesis swap it again and it becomes (d(bc)a).
can you find a link of a similar problem somewhere? Would like to know the problem constraints, and make sure I pass all the test cases.
Hi , when we code iterate version should'nt we add this before print it out.
if (visited.contains(currentVertex))
continue;
Because we get duplicate. You mention in theory but neglect it in code . Am i wrong?
Great explanation btw. keep it up love your videos , really helpful, i learnt a lot from you