(UVA) Claw Decomposition - Solution
Link to the problem: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=669&page=show_problem&problem=2391 For this problem, we need to find out if the graph is bipartite. The solution below used a Breath-First Search (BFS) to accomplish this task. import java.io.*; import java.util.*; class Main { public ArrayList<ArrayList<Integer>> adjList; public int[] nodes; public boolean bfs(int start, int numNodes) { Queue<Integer> queue = new ArrayDeque<>(); queue.add(start); nodes[start] = 0; while (queue.size() > 0) { int currNode = queue.poll();...