Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -13,7 +13,6 @@ public class RabinKarp {
public static final int d = 256;
public static void main(String[] args) {
scanner = new Scanner(System.in);
System.out.println("Enter String");
String text = scanner.nextLine();
@ -25,7 +24,6 @@ public class RabinKarp {
}
private static void searchPat(String text, String pattern, int q) {
int m = pattern.length();
int n = text.length();
int t = 0;
@ -45,7 +43,6 @@ public class RabinKarp {
}
for (i = 0; i <= n - m; i++) {
// if the calculated hash value of the pattern and text matches then
// all the characters of the pattern is matched with the text of length equal to length of the
// pattern
@ -54,10 +51,8 @@ public class RabinKarp {
// of the next character after the end
// of the evaluated characters is added
if (p == t) {
// if hash value matches then the individual characters are matched
for (j = 0; j < m; j++) {
// if not matched then break out of the loop
if (text.charAt(i + j) != pattern.charAt(j)) {
break;