Sabitlenmiş Tweet
Swaraj
9.6K posts

Swaraj
@SwaDotDev
Professional Over-thinker | Sad arc
Katılım Temmuz 2020
400 Takip Edilen2.1K Takipçiler

@DsThakurRawat I AM STRONG
nahi hota to mai dikhta nhi, humesha ke liye chla jata :)
हिन्दी
Swaraj retweetledi

@Divyansh91565 @SwaDotDev Hogaya ab khee se mee 😂
Ye toh predictable tha bhaiyo🫂
हिन्दी
Swaraj retweetledi

So I was solving a graph problem and the core intuition turned out to be just checking whether the graph is bipartite or not (plus a few extra conditions)...
So I thought maybe a article kind of , on this..
If you already understand how BFS/DFS works, here's a simple way to check bipartiteness:
Bipartite Graph Check -
> Most of you already know BFS/DFS.
> But many graph problems reduce to a simple question:
> Can we divide nodes into 2 groups such that no edge connects nodes of the same group?
If yes then graph is bipartite
Let's understand the core Idea:
Instead of thinking in groups, think in colors:
> Assign each node a color (0 or 1)
> For every edge -> colors must be different
So the problem becomes:
Can we 2-color the graph without conflicts?
Basic Working:
1. Start from any node:
2. Assign color = 0
3. Their neighbors = 1
4. Continue using BFS/DFS
While traversing:
If node is unvisited -> assign opposite color
If already visited and same color -> NOT bipartite
Why This Works?
Bipartite => No odd cycle
1) Even cycle -> works fine
2) Odd cycle -> forces same color conflict
First-Principles Thinking behind it:
This boils down to these points
At any node:
1. You only care about previously visited neighbors
2. Constraint: neighbor must have opposite color
3. So each step is just:
-> Check conflict
-> Assign color
-> Continue
That's it.

English

I dunno man, feminist / mra nahi hoon but feel like aise blanket statement is only gonna feed the irrationals. Diversity hiring is similar to reservation but it ain't like all the girls are trash. I would say there is a girl who is more brilliant than me in analog .....
Swaraj@SwaDotDev
not only IGDTUW, but almost sabhi cllgs ki girls aesa karti hai but again koi aake bolega that i am generalizing on gender basis, but this is true, and here its about majority, i have seen girls begging their male frnds to help them clear their OA rounds or some company assignment
English

@Divyansh91565 12 bje ke baad kiya kar ye sab post, usse phele padhen ka time ho ta hai
हिन्दी

@syntax_buddy @86pushkar24 lafda on this makes no sense, and they should accept reality, and here i am talking about majority as i already said
English

@Codewithdjj @SwaDotDev @86pushkar24 baat alag nahi hai, that's just the reality. as a friend, you obviously wouldn't say no to giving an oa for a female friend, but you rarely see the reverse happening. girls do help out, sure, but i've honestly never seen a girl give a guy's entire oa.
English

@Resorcinolworks peeping onto other's screen is not good habit
btw konsi metro line hai
English

@Divyansh91565 sorry ka post aa jana chahiye 5 min me, milking me, then will fb you else forget
English













