mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-25 05:22:39 +08:00
style: enable FinalClass
in checkstyle (#5154)
This commit is contained in:

committed by
GitHub

parent
52f15b2b08
commit
bbe4a025df
@ -13,7 +13,7 @@ public class Bag<Element> implements Iterable<Element> {
|
||||
private Node<Element> firstElement; // first element of the bag
|
||||
private int size; // size of bag
|
||||
|
||||
private static class Node<Element> {
|
||||
private static final class Node<Element> {
|
||||
|
||||
private Element content;
|
||||
private Node<Element> nextElement;
|
||||
|
@ -153,7 +153,7 @@ public class DynamicArray<E> implements Iterable<E> {
|
||||
return new DynamicArrayIterator();
|
||||
}
|
||||
|
||||
private class DynamicArrayIterator implements Iterator<E> {
|
||||
private final class DynamicArrayIterator implements Iterator<E> {
|
||||
|
||||
private int cursor;
|
||||
|
||||
|
@ -17,7 +17,7 @@ public final class WelshPowell {
|
||||
private WelshPowell() {
|
||||
}
|
||||
|
||||
static class Graph {
|
||||
static final class Graph {
|
||||
private HashSet<Integer>[] adjacencyLists;
|
||||
|
||||
private Graph(int vertices) {
|
||||
|
@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Intersection {
|
||||
public final class Intersection {
|
||||
|
||||
public static List<Integer> intersection(int[] arr1, int[] arr2) {
|
||||
if (arr1 == null || arr2 == null || arr1.length == 0 || arr2.length == 0) {
|
||||
|
@ -13,7 +13,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
|
||||
public class LeftistHeap {
|
||||
private class Node {
|
||||
private final class Node {
|
||||
private int element, npl;
|
||||
private Node left, right;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.thealgorithms.datastructures.lists;
|
||||
|
||||
public class CircleLinkedList<E> {
|
||||
|
||||
private static class Node<E> {
|
||||
private static final class Node<E> {
|
||||
|
||||
Node<E> next;
|
||||
E value;
|
||||
|
@ -43,7 +43,7 @@ public class Merge_K_SortedLinkedlist {
|
||||
return head;
|
||||
}
|
||||
|
||||
private class Node {
|
||||
private final class Node {
|
||||
|
||||
private int data;
|
||||
private Node next;
|
||||
|
@ -16,7 +16,7 @@ import java.util.Scanner;
|
||||
*/
|
||||
public class GenericTree {
|
||||
|
||||
private static class Node {
|
||||
private static final class Node {
|
||||
|
||||
int data;
|
||||
ArrayList<Node> child = new ArrayList<>();
|
||||
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class TreeRandomNode {
|
||||
|
||||
private class Node {
|
||||
private final class Node {
|
||||
|
||||
int item;
|
||||
Node left, right;
|
||||
|
Reference in New Issue
Block a user