diff --git a/checkstyle.xml b/checkstyle.xml
index 78ca487a414e..bff19ff79f17 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -148,7 +148,7 @@
-
+
diff --git a/src/main/java/com/thealgorithms/datastructures/bags/Bag.java b/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
index c82b9124bebc..66da3d34fcbf 100644
--- a/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
+++ b/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
@@ -80,7 +80,7 @@ private class ListIterator implements Iterator {
private Node currentElement;
- public ListIterator(Node firstElement) {
+ ListIterator(Node firstElement) {
currentElement = firstElement;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java b/src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java
index db85afa18c81..a327690d7896 100644
--- a/src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java
+++ b/src/main/java/com/thealgorithms/datastructures/bloomfilter/BloomFilter.java
@@ -42,7 +42,7 @@ private class Hash {
int index;
- public Hash(int index) {
+ Hash(int index) {
this.index = index;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java b/src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java
index 5e1c815ff9b3..63295b83abe6 100644
--- a/src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java
+++ b/src/main/java/com/thealgorithms/datastructures/buffers/CircularBuffer.java
@@ -43,7 +43,7 @@ private static class CircularPointer {
private int pointer;
private final int max;
- public CircularPointer(int pointer, int max) {
+ CircularPointer(int pointer, int max) {
this.pointer = pointer;
this.max = max;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java b/src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java
index 03a1d59e1b20..6e37b4a7109d 100644
--- a/src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java
+++ b/src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java
@@ -17,7 +17,7 @@ private class Node {
private Node previous;
private Node next;
- public Node(K key, V value, int frequency) {
+ Node(K key, V value, int frequency) {
this.key = key;
this.value = value;
this.frequency = frequency;
diff --git a/src/main/java/com/thealgorithms/datastructures/caches/LRUCache.java b/src/main/java/com/thealgorithms/datastructures/caches/LRUCache.java
index fcb7d975bdb4..97818ff83351 100644
--- a/src/main/java/com/thealgorithms/datastructures/caches/LRUCache.java
+++ b/src/main/java/com/thealgorithms/datastructures/caches/LRUCache.java
@@ -126,10 +126,10 @@ static final class Entry {
private I key;
private J value;
- public Entry() {
+ Entry() {
}
- public Entry(Entry preEntry, Entry nextEntry, I key, J value) {
+ Entry(Entry preEntry, Entry nextEntry, I key, J value) {
this.preEntry = preEntry;
this.nextEntry = nextEntry;
this.key = key;
diff --git a/src/main/java/com/thealgorithms/datastructures/caches/MRUCache.java b/src/main/java/com/thealgorithms/datastructures/caches/MRUCache.java
index 30f914968c3b..9c155be8b195 100644
--- a/src/main/java/com/thealgorithms/datastructures/caches/MRUCache.java
+++ b/src/main/java/com/thealgorithms/datastructures/caches/MRUCache.java
@@ -124,10 +124,10 @@ static final class Entry {
private I key;
private J value;
- public Entry() {
+ Entry() {
}
- public Entry(Entry preEntry, Entry nextEntry, I key, J value) {
+ Entry(Entry preEntry, Entry nextEntry, I key, J value) {
this.preEntry = preEntry;
this.nextEntry = nextEntry;
this.key = key;
diff --git a/src/main/java/com/thealgorithms/datastructures/crdt/GCounter.java b/src/main/java/com/thealgorithms/datastructures/crdt/GCounter.java
index 63364f858ec5..ced55d87a3cf 100644
--- a/src/main/java/com/thealgorithms/datastructures/crdt/GCounter.java
+++ b/src/main/java/com/thealgorithms/datastructures/crdt/GCounter.java
@@ -26,7 +26,7 @@ class GCounter {
*
* @param n The number of nodes in the cluster.
*/
- public GCounter(int myId, int n) {
+ GCounter(int myId, int n) {
this.myId = myId;
this.n = n;
this.P = new HashMap<>();
diff --git a/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java b/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java
index 722c916ab0ce..b8b296359844 100644
--- a/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java
+++ b/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java
@@ -26,7 +26,7 @@ class Element {
* @param timestamp The timestamp associated with the element.
* @param bias The bias of the element (ADDS or REMOVALS).
*/
- public Element(String key, int timestamp, Bias bias) {
+ Element(String key, int timestamp, Bias bias) {
this.key = key;
this.timestamp = timestamp;
this.bias = bias;
@@ -49,7 +49,7 @@ class LWWElementSet {
/**
* Constructs an empty LWWElementSet.
*/
- public LWWElementSet() {
+ LWWElementSet() {
this.addSet = new HashMap<>();
this.removeSet = new HashMap<>();
}
diff --git a/src/main/java/com/thealgorithms/datastructures/crdt/PNCounter.java b/src/main/java/com/thealgorithms/datastructures/crdt/PNCounter.java
index 828e0b0804b3..04b846758f37 100644
--- a/src/main/java/com/thealgorithms/datastructures/crdt/PNCounter.java
+++ b/src/main/java/com/thealgorithms/datastructures/crdt/PNCounter.java
@@ -28,7 +28,7 @@ class PNCounter {
* @param myId The identifier of the current node.
* @param n The number of nodes in the cluster.
*/
- public PNCounter(int myId, int n) {
+ PNCounter(int myId, int n) {
this.myId = myId;
this.n = n;
this.P = new HashMap<>();
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java b/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java
index 8cd28378d9d3..6d02afbeb652 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/A_Star.java
@@ -14,7 +14,7 @@ private static class Graph {
private ArrayList> 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 @@ private static class Edge {
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 @@ private static class PathAndDistance {
private ArrayList 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 path, int estimated) {
+ PathAndDistance(int distance, ArrayList path, int estimated) {
this.distance = distance;
this.path = path;
this.estimated = estimated;
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java b/src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java
index 9f5022b44465..3251b7365b67 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/BellmanFord.java
@@ -31,7 +31,7 @@ class Edge {
* @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;
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/ConnectedComponent.java b/src/main/java/com/thealgorithms/datastructures/graphs/ConnectedComponent.java
index b0add255f59a..9b6ff9010445 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/ConnectedComponent.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/ConnectedComponent.java
@@ -15,7 +15,7 @@ class Node {
E name;
- public Node(E name) {
+ Node(E name) {
this.name = name;
}
}
@@ -24,7 +24,7 @@ class Edge {
Node startNode, endNode;
- public Edge(Node startNode, Node endNode) {
+ Edge(Node startNode, Node endNode) {
this.startNode = startNode;
this.endNode = endNode;
}
@@ -33,7 +33,7 @@ public Edge(Node startNode, Node endNode) {
ArrayList edgeList;
ArrayList nodeList;
- public Graph() {
+ Graph() {
edgeList = new ArrayList();
nodeList = new ArrayList();
}
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/Cycles.java b/src/main/java/com/thealgorithms/datastructures/graphs/Cycles.java
index 5d5bd3c7469c..7995e0146190 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/Cycles.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/Cycles.java
@@ -10,7 +10,7 @@ class Cycle {
private boolean[] visited;
ArrayList> cycles = new ArrayList>();
- public Cycle() {
+ Cycle() {
Scanner in = new Scanner(System.in);
System.out.print("Enter the no. of nodes: ");
nodes = in.nextInt();
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/Graphs.java b/src/main/java/com/thealgorithms/datastructures/graphs/Graphs.java
index 77cea399c173..01aa1085867b 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/Graphs.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/Graphs.java
@@ -6,7 +6,7 @@ class AdjacencyListGraph> {
ArrayList vertices;
- public AdjacencyListGraph() {
+ AdjacencyListGraph() {
vertices = new ArrayList<>();
}
@@ -15,7 +15,7 @@ private class Vertex {
E data;
ArrayList adjacentVertices;
- public Vertex(E data) {
+ Vertex(E data) {
adjacentVertices = new ArrayList<>();
this.data = data;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/Kruskal.java b/src/main/java/com/thealgorithms/datastructures/graphs/Kruskal.java
index bf5afcd13fda..eb5b65d5c0d4 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/Kruskal.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/Kruskal.java
@@ -23,7 +23,7 @@ private static class Edge {
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;
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java b/src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java
index 0348a60bc135..d595d53c1b61 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/MatrixGraphs.java
@@ -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]);
diff --git a/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArrayList.java b/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArrayList.java
index e45d827afec7..a1ef457f3432 100644
--- a/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArrayList.java
+++ b/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/GenericHashMapUsingArrayList.java
@@ -105,7 +105,7 @@ private class Node {
K key;
V val;
- public Node(K key, V val) {
+ Node(K key, V val) {
this.key = key;
this.val = val;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/lists/DoublyLinkedList.java b/src/main/java/com/thealgorithms/datastructures/lists/DoublyLinkedList.java
index 89117786c35e..7f10d7cd93a6 100644
--- a/src/main/java/com/thealgorithms/datastructures/lists/DoublyLinkedList.java
+++ b/src/main/java/com/thealgorithms/datastructures/lists/DoublyLinkedList.java
@@ -110,7 +110,7 @@ class Link {
*
* @param value Value of node
*/
- public Link(int value) {
+ Link(int value) {
this.value = value;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/lists/SkipList.java b/src/main/java/com/thealgorithms/datastructures/lists/SkipList.java
index 33e3fd7cdb20..114a22d4b8c8 100644
--- a/src/main/java/com/thealgorithms/datastructures/lists/SkipList.java
+++ b/src/main/java/com/thealgorithms/datastructures/lists/SkipList.java
@@ -222,7 +222,7 @@ private static class Node {
private final List> backward;
@SuppressWarnings("unchecked")
- public Node(E value, int height) {
+ Node(E value, int height) {
this.value = value;
this.height = height;
diff --git a/src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java b/src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java
index 8b33e08c3808..b552ac2918a3 100644
--- a/src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java
+++ b/src/main/java/com/thealgorithms/datastructures/queues/LinkedQueue.java
@@ -11,15 +11,15 @@ static class Node {
T data;
Node next;
- public Node() {
+ Node() {
this(null);
}
- public Node(T data) {
+ Node(T data) {
this(data, null);
}
- public Node(T data, Node next) {
+ Node(T data, Node next) {
this.data = data;
this.next = next;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java b/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java
index dec25d2ff694..16a0c1673886 100644
--- a/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java
+++ b/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java
@@ -30,7 +30,7 @@ class PriorityQueue {
* Default Constructor
*/
- public PriorityQueue() {
+ PriorityQueue() {
/* If capacity is not defined, default size of 11 would be used
* capacity=max+1 because we cant access 0th element of PQ, and to
* accomodate (max)th elements we need capacity to be max+1.
@@ -50,7 +50,7 @@ public PriorityQueue() {
* @param size Size of the queue
*/
- public PriorityQueue(int size) {
+ PriorityQueue(int size) {
maxSize = size + 1;
queueArray = new int[maxSize];
nItems = 0;
diff --git a/src/main/java/com/thealgorithms/datastructures/queues/Queues.java b/src/main/java/com/thealgorithms/datastructures/queues/Queues.java
index bcc292b3e9a9..a8fabf7b8859 100644
--- a/src/main/java/com/thealgorithms/datastructures/queues/Queues.java
+++ b/src/main/java/com/thealgorithms/datastructures/queues/Queues.java
@@ -38,7 +38,7 @@ class Queue {
/**
* init with DEFAULT_CAPACITY
*/
- public Queue() {
+ Queue() {
this(DEFAULT_CAPACITY);
}
@@ -47,7 +47,7 @@ public Queue() {
*
* @param size Size of the new queue
*/
- public Queue(int size) {
+ Queue(int size) {
maxSize = size;
queueArray = new int[size];
front = 0;
diff --git a/src/main/java/com/thealgorithms/datastructures/stacks/StackOfLinkedList.java b/src/main/java/com/thealgorithms/datastructures/stacks/StackOfLinkedList.java
index 0463018fde82..afe002fa3651 100644
--- a/src/main/java/com/thealgorithms/datastructures/stacks/StackOfLinkedList.java
+++ b/src/main/java/com/thealgorithms/datastructures/stacks/StackOfLinkedList.java
@@ -33,7 +33,7 @@ class Node {
public int data;
public Node next;
- public Node(int data) {
+ Node(int data) {
this.data = data;
this.next = null;
}
@@ -60,7 +60,7 @@ class LinkedListStack {
/**
* Init properties
*/
- public LinkedListStack() {
+ LinkedListStack() {
head = null;
size = 0;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java b/src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java
index d699b436d6b9..d4d677a4cda0 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/BinaryTree.java
@@ -47,7 +47,7 @@ static class Node {
*
* @param value Value to put in the node
*/
- public Node(int value) {
+ Node(int value) {
data = value;
left = null;
right = null;
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java b/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java
index 577c0055d9b6..c3be07eef0ab 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java
@@ -68,7 +68,7 @@ public int getDimension() {
return coordinates.length;
}
- public Point(int[] coordinates) {
+ Point(int[] coordinates) {
this.coordinates = coordinates;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/LazySegmentTree.java b/src/main/java/com/thealgorithms/datastructures/trees/LazySegmentTree.java
index b5a9db9f5e11..6eff3c38b94c 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/LazySegmentTree.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/LazySegmentTree.java
@@ -15,7 +15,7 @@ static class Node {
private int lazy; // lazied value that should be added to children nodes
Node left, right; // left and right children
- public Node(int start, int end, int value) {
+ Node(int start, int end, int value) {
this.start = start;
this.end = end;
this.value = value;
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/PrintTopViewofTree.java b/src/main/java/com/thealgorithms/datastructures/trees/PrintTopViewofTree.java
index a2dbeca5ebac..7560e90cd008 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/PrintTopViewofTree.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/PrintTopViewofTree.java
@@ -13,7 +13,7 @@ class TreeNode {
TreeNode left, right;
// Constructor
- public TreeNode(int key) {
+ TreeNode(int key) {
this.key = key;
left = right = null;
}
@@ -27,7 +27,7 @@ class QItem {
TreeNode node;
int hd;
- public QItem(TreeNode n, int h) {
+ QItem(TreeNode n, int h) {
node = n;
hd = h;
}
@@ -39,11 +39,11 @@ class Tree {
TreeNode root;
// Constructors
- public Tree() {
+ Tree() {
root = null;
}
- public Tree(TreeNode n) {
+ Tree(TreeNode n) {
root = n;
}
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/nearestRightKey.java b/src/main/java/com/thealgorithms/datastructures/trees/nearestRightKey.java
index 913ccda3828c..dd6df1481c99 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/nearestRightKey.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/nearestRightKey.java
@@ -53,13 +53,13 @@ class NRKTree {
public NRKTree right;
public int data;
- public NRKTree(int x) {
+ NRKTree(int x) {
this.left = null;
this.right = null;
this.data = x;
}
- public NRKTree(NRKTree right, NRKTree left, int x) {
+ NRKTree(NRKTree right, NRKTree left, int x) {
this.left = left;
this.right = right;
this.data = x;
diff --git a/src/main/java/com/thealgorithms/greedyalgorithms/JobSequencing.java b/src/main/java/com/thealgorithms/greedyalgorithms/JobSequencing.java
index 83ed40d2a1be..113918263cd3 100644
--- a/src/main/java/com/thealgorithms/greedyalgorithms/JobSequencing.java
+++ b/src/main/java/com/thealgorithms/greedyalgorithms/JobSequencing.java
@@ -19,7 +19,7 @@ public int compareTo(Job otherJob) {
return otherJob.profit - this.profit;
}
- public Job(char id, int deadline, int profit) {
+ Job(char id, int deadline, int profit) {
this.id = id;
this.deadline = deadline;
this.profit = profit;
diff --git a/src/main/java/com/thealgorithms/maths/FFT.java b/src/main/java/com/thealgorithms/maths/FFT.java
index f50bec52997b..f745917749e5 100644
--- a/src/main/java/com/thealgorithms/maths/FFT.java
+++ b/src/main/java/com/thealgorithms/maths/FFT.java
@@ -27,7 +27,7 @@ static class Complex {
/**
* Default Constructor. Creates the complex number 0.
*/
- public Complex() {
+ Complex() {
real = 0;
img = 0;
}
@@ -38,7 +38,7 @@ public Complex() {
* @param r The real part of the number.
* @param i The imaginary part of the number.
*/
- public Complex(double r, double i) {
+ Complex(double r, double i) {
real = r;
img = i;
}
diff --git a/src/main/java/com/thealgorithms/misc/WordBoggle.java b/src/main/java/com/thealgorithms/misc/WordBoggle.java
index 0dfbd89def99..5b3b8f86af10 100644
--- a/src/main/java/com/thealgorithms/misc/WordBoggle.java
+++ b/src/main/java/com/thealgorithms/misc/WordBoggle.java
@@ -127,7 +127,7 @@ class Trie {
TrieNode root;
char endSymbol;
- public Trie() {
+ Trie() {
this.root = new TrieNode();
this.endSymbol = '*';
}
diff --git a/src/main/java/com/thealgorithms/others/Dijkstra.java b/src/main/java/com/thealgorithms/others/Dijkstra.java
index 4886dc4ce7a4..3218c7bf43de 100644
--- a/src/main/java/com/thealgorithms/others/Dijkstra.java
+++ b/src/main/java/com/thealgorithms/others/Dijkstra.java
@@ -61,7 +61,7 @@ public static class Edge {
public final String v1, v2;
public final int dist;
- public Edge(String v1, String v2, int dist) {
+ Edge(String v1, String v2, int dist) {
this.v1 = v1;
this.v2 = v2;
this.dist = dist;
@@ -79,7 +79,7 @@ public static class Vertex implements Comparable {
public Vertex previous = null;
public final Map neighbours = new HashMap<>();
- public Vertex(String name) {
+ Vertex(String name) {
this.name = name;
}
@@ -147,7 +147,7 @@ public String toString() {
/**
* Builds a graph from a set of edges
*/
- public Graph(Edge[] edges) {
+ Graph(Edge[] edges) {
graph = new HashMap<>(edges.length);
// one pass to find all vertices
diff --git a/src/main/java/com/thealgorithms/others/KochSnowflake.java b/src/main/java/com/thealgorithms/others/KochSnowflake.java
index 8395b1f486a7..04abc2dd8993 100644
--- a/src/main/java/com/thealgorithms/others/KochSnowflake.java
+++ b/src/main/java/com/thealgorithms/others/KochSnowflake.java
@@ -176,7 +176,7 @@ private static class Vector2 {
double x, y;
- public Vector2(double x, double y) {
+ Vector2(double x, double y) {
this.x = x;
this.y = y;
}
diff --git a/src/main/java/com/thealgorithms/others/QueueUsingTwoStacks.java b/src/main/java/com/thealgorithms/others/QueueUsingTwoStacks.java
index 6b766dc3f5a0..2499d9373354 100644
--- a/src/main/java/com/thealgorithms/others/QueueUsingTwoStacks.java
+++ b/src/main/java/com/thealgorithms/others/QueueUsingTwoStacks.java
@@ -25,7 +25,7 @@ class QueueWithStack {
/**
* Constructor
*/
- public QueueWithStack() {
+ QueueWithStack() {
this.inStack = new Stack<>();
this.outStack = new Stack<>();
}
diff --git a/src/main/java/com/thealgorithms/others/TopKWords.java b/src/main/java/com/thealgorithms/others/TopKWords.java
index 664a3ec92eac..43e71173d096 100644
--- a/src/main/java/com/thealgorithms/others/TopKWords.java
+++ b/src/main/java/com/thealgorithms/others/TopKWords.java
@@ -11,7 +11,7 @@ static class CountWords {
private String fileName;
- public CountWords(String fileName) {
+ CountWords(String fileName) {
this.fileName = fileName;
}
diff --git a/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java b/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
index 7b058bcee625..4523f6824410 100644
--- a/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
@@ -13,7 +13,7 @@ class Process {
int burstTime;
int priority;
- public Process(String name, int arrivalTime, int burstTime, int priority) {
+ Process(String name, int arrivalTime, int burstTime, int priority) {
this.name = name;
this.arrivalTime = arrivalTime;
this.burstTime = burstTime;
diff --git a/src/main/java/com/thealgorithms/sorts/TopologicalSort.java b/src/main/java/com/thealgorithms/sorts/TopologicalSort.java
index 76d527ce756d..1ba918275b7d 100644
--- a/src/main/java/com/thealgorithms/sorts/TopologicalSort.java
+++ b/src/main/java/com/thealgorithms/sorts/TopologicalSort.java
@@ -43,7 +43,7 @@ private static class Vertex {
* */
public final ArrayList next = new ArrayList<>();
- public Vertex(String label) {
+ Vertex(String label) {
this.label = label;
}
}
@@ -69,7 +69,7 @@ public void addEdge(String label, String... next) {
static class BackEdgeException extends RuntimeException {
- public BackEdgeException(String backEdge) {
+ BackEdgeException(String backEdge) {
super("This graph contains a cycle. No linear ordering is possible. " + backEdge);
}
}