Is Graph Bipartite? | leetcode 785 | Hindi
Вставка
- Опубліковано 11 жов 2024
- liked this video? Click here / @codebix1096 join our facebook group :- / 258049468776636
problem :- leetcode.com/p...
code :- github.com/luc...
graph playlist :- • Graph Intoduction
Channel Intro 🔥🔥🔥🔥🔥🔥
beautiful colors. very helpful explanation.
sable badiya channel
your explanation is from basic, a lemon person can also understood. Thanks a ton for Leetcode playlist
one mistake 8:36 In queue there should be 3 instead of 2.
Yaa
awesomeee sir
I almost gave up on this question! Great explanation, thanks!!
Glad it was helpful!
Wonderful explanation . I liked the way you sunk your code explanation along with the diagrammatic explanation . This way i understood the code clearly
Glad it helped!
Follow our linkedin page for regular updates www.linkedin.com/company/codebix/?viewAsMember=true
This is awesome. I simply could not understand the logic behind coloring but thanks to you, now I fully understand it. Keep uploading!
@codebix Thanks a lot for such an amazing explanation. Sir pls keep uploading more videos on DS Algo and system design as well. We all are proud of you!!
Best explanation ever......
Thanks Pratham :)
please share this channel with your friends
great sir , can you do backtrack problems here also
Nice sir... Keep on making more videos on Graphs
Sure I will
There could not have been a better explanation for this topic. One ques though Even vertex cycle always guarantee bipartisanship?
For python users:
class Solution:
def isBipartite(self, graph: List[List[int]]) -> bool:
colors = [0]*len(graph)
for i in range(len(graph)):
if colors[i]:
continue
queue = []
queue.append(i)
colors[i] = 1
print(queue)
while queue:
front = queue.pop(0)
for i in graph[front]:
if colors[i] == 0:
colors[i] = -colors[front]
queue.append(i)
if colors[i] == colors[front]:
return False
return True
no i said odd cycle always guarantee bipartite graph.. other then that we need to check
@@codebix1096 I guess you mean odd cycle guarantee 'No Bipartite Graph' Possible
Isn't 0's childs are 1 and 3?
But u put 1 and 2 in the queue!!!!!!
yaa i also got confused there 😀
itna dimag to tere mein khud bhi hona chaiye, patthar chabata hai kya
@@TuringTested01 ronaldo ka hater patthar chabate hein ye to sure hein bhai
One MisTake Brother on 18:07 *Array Index [2] ==1* it should be * 1* , Other wise ** its *Adjacent Vertex index[1]== -1* and * index[3]==-1* are same colour
thanks for correction