style: enable LocalVariableName in CheckStyle (#5191)

* style: enable LocalVariableName in checkstyle

* Removed minor bug

* Resolved Method Name Bug

* Changed names according to suggestions
This commit is contained in:
S. Utkarsh
2024-05-28 23:59:28 +05:30
committed by GitHub
parent 81cb09b1f8
commit 25d711c5d8
45 changed files with 418 additions and 417 deletions

View File

@ -11,7 +11,7 @@ public final class Main {
int key;
HashMap h = new HashMap(7);
Scanner In = new Scanner(System.in);
Scanner scan = new Scanner(System.in);
while (true) {
System.out.println("Enter your Choice :");
@ -20,18 +20,18 @@ public final class Main {
System.out.println("3. Print Table");
System.out.println("4. Exit");
choice = In.nextInt();
choice = scan.nextInt();
switch (choice) {
case 1: {
System.out.println("Enter the Key: ");
key = In.nextInt();
key = scan.nextInt();
h.insertHash(key);
break;
}
case 2: {
System.out.println("Enter the Key delete: ");
key = In.nextInt();
key = scan.nextInt();
h.deleteHash(key);
break;
}
@ -41,7 +41,7 @@ public final class Main {
break;
}
case 4: {
In.close();
scan.close();
return;
}
default: {

View File

@ -11,7 +11,7 @@ public final class MainCuckooHashing {
int key;
HashMapCuckooHashing h = new HashMapCuckooHashing(7);
Scanner In = new Scanner(System.in);
Scanner scan = new Scanner(System.in);
while (true) {
System.out.println("_________________________");
@ -24,18 +24,18 @@ public final class MainCuckooHashing {
System.out.println("6. Check load factor");
System.out.println("7. Rehash Current Table");
choice = In.nextInt();
choice = scan.nextInt();
switch (choice) {
case 1: {
System.out.println("Enter the Key: ");
key = In.nextInt();
key = scan.nextInt();
h.insertKey2HashTable(key);
break;
}
case 2: {
System.out.println("Enter the Key delete: ");
key = In.nextInt();
key = scan.nextInt();
h.deleteKeyFromHashTable(key);
break;
}
@ -45,12 +45,12 @@ public final class MainCuckooHashing {
break;
}
case 4: {
In.close();
scan.close();
return;
}
case 5: {
System.out.println("Enter the Key to find and print: ");
key = In.nextInt();
key = scan.nextInt();
System.out.println("Key: " + key + " is at index: " + h.findKeyInTable(key) + "\n");
break;
}