style: enable MethodName in CheckStyle (#5182)

enabled: MethodName in CheckStyle
This commit is contained in:
Godwill Christopher
2024-05-27 01:06:06 -06:00
committed by GitHub
parent ea4dc15a24
commit 295e7436b1
53 changed files with 225 additions and 225 deletions

View File

@@ -25,10 +25,10 @@ public class GenericTree {
private final Node root;
public GenericTree() { // Constructor
Scanner scn = new Scanner(System.in);
root = create_treeG(null, 0, scn);
root = createTreeG(null, 0, scn);
}
private Node create_treeG(Node node, int childIndex, Scanner scanner) {
private Node createTreeG(Node node, int childIndex, Scanner scanner) {
// display
if (node == null) {
System.out.println("Enter root's data");
@@ -41,7 +41,7 @@ public class GenericTree {
System.out.println("number of children");
int number = scanner.nextInt();
for (int i = 0; i < number; i++) {
Node child = create_treeG(node, i, scanner);
Node child = createTreeG(node, i, scanner);
node.child.add(child);
}
return node;
@@ -51,17 +51,17 @@ public class GenericTree {
* Function to display the generic tree
*/
public void display() { // Helper function
display_1(root);
display1(root);
}
private void display_1(Node parent) {
private void display1(Node parent) {
System.out.print(parent.data + "=>");
for (int i = 0; i < parent.child.size(); i++) {
System.out.print(parent.child.get(i).data + " ");
}
System.out.println(".");
for (int i = 0; i < parent.child.size(); i++) {
display_1(parent.child.get(i));
display1(parent.child.get(i));
}
}

View File

@@ -8,7 +8,7 @@ final class NearestRightKey {
}
public static void main(String[] args) {
NRKTree root = BuildTree();
NRKTree root = buildTree();
Scanner sc = new Scanner(System.in);
System.out.print("Enter first number: ");
int inputX0 = sc.nextInt();
@@ -17,7 +17,7 @@ final class NearestRightKey {
sc.close();
}
public static NRKTree BuildTree() {
public static NRKTree buildTree() {
int randomX = ThreadLocalRandom.current().nextInt(0, 100 + 1);
NRKTree root = new NRKTree(null, null, randomX);