style: enable RedundantModifier in checkstyle (#5140)

This commit is contained in:
Piotr Idzik
2024-05-03 21:10:49 +02:00
committed by GitHub
parent 1e2d7e9431
commit b3903f5768
38 changed files with 59 additions and 59 deletions

View File

@ -14,7 +14,7 @@ public class A_Star {
private ArrayList<ArrayList<Edge>> graph;
// Initialise ArrayLists in Constructor
public Graph(int size) {
Graph(int size) {
this.graph = new ArrayList<>();
for (int i = 0; i < size; i++) {
this.graph.add(new ArrayList<>());
@ -38,7 +38,7 @@ public class A_Star {
private int to;
private int weight;
public Edge(int from, int to, int weight) {
Edge(int from, int to, int weight) {
this.from = from;
this.to = to;
this.weight = weight;
@ -64,7 +64,7 @@ public class A_Star {
private ArrayList<Integer> path; // list of visited nodes in this path.
private int estimated; // heuristic value associated to the last node od the path (current node).
public PathAndDistance(int distance, ArrayList<Integer> path, int estimated) {
PathAndDistance(int distance, ArrayList<Integer> path, int estimated) {
this.distance = distance;
this.path = path;
this.estimated = estimated;

View File

@ -31,7 +31,7 @@ class BellmanFord /*
* @param v End vertex
* @param c Weight
*/
public Edge(int a, int b, int c) {
Edge(int a, int b, int c) {
u = a;
v = b;
w = c;

View File

@ -15,7 +15,7 @@ class Graph<E extends Comparable<E>> {
E name;
public Node(E name) {
Node(E name) {
this.name = name;
}
}
@ -24,7 +24,7 @@ class Graph<E extends Comparable<E>> {
Node startNode, endNode;
public Edge(Node startNode, Node endNode) {
Edge(Node startNode, Node endNode) {
this.startNode = startNode;
this.endNode = endNode;
}
@ -33,7 +33,7 @@ class Graph<E extends Comparable<E>> {
ArrayList<Edge> edgeList;
ArrayList<Node> nodeList;
public Graph() {
Graph() {
edgeList = new ArrayList<Edge>();
nodeList = new ArrayList<Node>();
}

View File

@ -10,7 +10,7 @@ class Cycle {
private boolean[] visited;
ArrayList<ArrayList<Integer>> cycles = new ArrayList<ArrayList<Integer>>();
public Cycle() {
Cycle() {
Scanner in = new Scanner(System.in);
System.out.print("Enter the no. of nodes: ");
nodes = in.nextInt();

View File

@ -6,7 +6,7 @@ class AdjacencyListGraph<E extends Comparable<E>> {
ArrayList<Vertex> vertices;
public AdjacencyListGraph() {
AdjacencyListGraph() {
vertices = new ArrayList<>();
}
@ -15,7 +15,7 @@ class AdjacencyListGraph<E extends Comparable<E>> {
E data;
ArrayList<Vertex> adjacentVertices;
public Vertex(E data) {
Vertex(E data) {
adjacentVertices = new ArrayList<>();
this.data = data;
}

View File

@ -23,7 +23,7 @@ public class Kruskal {
private int to;
private int weight;
public Edge(int from, int to, int weight) {
Edge(int from, int to, int weight) {
this.from = from;
this.to = to;
this.weight = weight;

View File

@ -68,7 +68,7 @@ class AdjacencyMatrixGraph {
/**
* Constructor
*/
public AdjacencyMatrixGraph(int givenNumberOfVertices) {
AdjacencyMatrixGraph(int givenNumberOfVertices) {
this.setNumberOfVertices(givenNumberOfVertices);
this.setNumberOfEdges(0);
this.setAdjacency(new int[givenNumberOfVertices][givenNumberOfVertices]);