mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-25 05:22:39 +08:00
style: include NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
(#5149)
* style: use `assertFalse` and `assertTrue` * style: include `NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION`
This commit is contained in:
@ -34,7 +34,7 @@ class dijkstras {
|
||||
|
||||
for (int i = 0; i < k; i++) {
|
||||
dist[i] = Integer.MAX_VALUE;
|
||||
Set[i] = false;
|
||||
Set[i] = Boolean.FALSE;
|
||||
}
|
||||
|
||||
dist[src] = 0;
|
||||
@ -42,7 +42,7 @@ class dijkstras {
|
||||
for (int c = 0; c < k - 1; c++) {
|
||||
int u = minDist(dist, Set);
|
||||
|
||||
Set[u] = true;
|
||||
Set[u] = Boolean.TRUE;
|
||||
|
||||
for (int v = 0; v < k; v++) {
|
||||
if (!Set[v] && graph[u][v] != 0 && dist[u] != Integer.MAX_VALUE && dist[u] + graph[u][v] < dist[v]) {
|
||||
|
@ -50,7 +50,7 @@ class PrimMST {
|
||||
// Initialize all keys as INFINITE
|
||||
for (int i = 0; i < V; i++) {
|
||||
key[i] = Integer.MAX_VALUE;
|
||||
mstSet[i] = false;
|
||||
mstSet[i] = Boolean.FALSE;
|
||||
}
|
||||
|
||||
// Always include first 1st vertex in MST.
|
||||
@ -65,7 +65,7 @@ class PrimMST {
|
||||
int u = minKey(key, mstSet);
|
||||
|
||||
// Add the picked vertex to the MST Set
|
||||
mstSet[u] = true;
|
||||
mstSet[u] = Boolean.TRUE;
|
||||
|
||||
// Update key value and parent index of the adjacent
|
||||
// vertices of the picked vertex. Consider only those
|
||||
|
Reference in New Issue
Block a user