From 96fd7e5a38e4df4edc34d71fd7c2fe59f110423d Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:26:03 +0530 Subject: [PATCH 1/9] Delete BMA.java --- BMA.java | 70 -------------------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 BMA.java diff --git a/BMA.java b/BMA.java deleted file mode 100644 index 79b5f01..0000000 --- a/BMA.java +++ /dev/null @@ -1,70 +0,0 @@ -package Algorithms; -public class BMA -{ - /*public static void main(String[] args) - { - //(BoyerMoore("Is the pattern a substring?", "substr")); - }*/ - - public void BoyerMoore(String T, String P) - { - int flag=0,pos=0; - int i = P.length() -1; - int j = P.length() -1; - do - { - if (P.charAt(j) == T.charAt(i)) - { - if (j == 0) - { - pos=i; - flag=1;// pattern found - System.out.println("Pattern found at position: "+ pos); - break; - - } - else - { - i--; - j--; - } - } - else - { - i = i + P.length() - min(j, 1+last(T.charAt(i), P)); - j = P.length()-1; - } - } while(i <= T.length()-1); - - if(flag==1) - System.out.println("Pattern found at position: "+ pos); - else - System.out.println("Pattern not found"); - - } - // Returns index of last occurrence of character in pattern. - - public static int last(char c, String P) - { - for (int i=P.length()-1; i>=0; i--) - { - if (P.charAt(i) == c) - { - return i; - } - } - return -1; - } - - - // Returns the minimum of two integers. - public static int min(int a, int b) - { - if (a < b) - return a; - else if (b < a) - return b; - else - return a; - } -} From aab6340a0ff888c111c347c4bb1a711902ab120f Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:26:17 +0530 Subject: [PATCH 2/9] Delete Execute.java --- Execute.java | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Execute.java diff --git a/Execute.java b/Execute.java deleted file mode 100644 index d51726b..0000000 --- a/Execute.java +++ /dev/null @@ -1,46 +0,0 @@ -package Algorithms; -import java.util.*; -import java.lang.*; -public class Execute -{ - public static void main(String args[]) - { - Naive obj1 =new Naive(); - Rabin_karp obj2=new Rabin_karp(); - KMP obj3=new KMP(); - BMA obj4=new BMA(); - - Scanner sc=new Scanner(System.in); - System.out.println("Enter the string: "); - String givenstr=sc.next(); - System.out.println("Enter the Pattern to be matched: "); - String pattern = sc.next(); - - while(true) { - System.out.println("CHOOSE A STRING MATCHING ALGORITHM: /n1.Naive /n2.Rabin Karp /n3.Knuth Moris Patt /n4.Boyer Moore /n5.Exit "); - int choice=sc.nextInt(); - - switch(choice) - { - case 1: obj1.Naivesearch(pattern, givenstr); - break; - - case 2: int q=101; - obj2.RKsearch(pattern,givenstr,q); - break; - - case 3:obj3.KMPmatcher(givenstr,pattern); - break; - case 4:obj4.BoyerMoore(givenstr,pattern); - break; - - case 5: System.exit(0); - default:System.out.println("Invalid Input"); - - } - - } - - } - -} From 8486ef3cd6872e670aaa9824bd5b8be063669418 Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:26:41 +0530 Subject: [PATCH 3/9] Delete KMP.java --- KMP.java | 57 -------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 KMP.java diff --git a/KMP.java b/KMP.java deleted file mode 100644 index 1360d7a..0000000 --- a/KMP.java +++ /dev/null @@ -1,57 +0,0 @@ -package Algorithms; -public class KMP -{ - - /* public static void main(String[] args) { - final String givenstr = "AAAAABAAABA"; //This is the full string - final String pattern= "AAAA"; //This is the substring that we want to find - KMPmatcher(haystack, needle); - }*/ - - public static void KMPmatcher(final String givenstr, final String pattern) { - final int m = givenstr.length(); - final int n = pattern.length(); - int flag=0; - final int[] pi = computePrefixFunction(pattern); - int q = 0; - for (int i = 0; i < m; i++) { - while (q > 0 && givenstr.charAt(i) != pattern.charAt(q)) { - q = pi[q - 1]; - } - - if (givenstr.charAt(i) == pattern.charAt(q)) { - q++; - } - - if (q == n) { - flag=1; - System.out.println("Pattern found at " + (i + 1 - n)); - q = pi[q - 1]; - } - } - if(flag==0) - System.out.println("Pattern not found"); - } - - // return the prefix function - static int[] computePrefixFunction(final String P) { - final int n = P.length(); - final int[] pi = new int[n]; - pi[0] = 0; - int q = 0; - for (int i = 1; i < n; i++) { - while (q > 0 && P.charAt(q) != P.charAt(i)) { - q = pi[q - 1]; - } - - if (P.charAt(q) == P.charAt(i)) { - q++; - } - - pi[i] = q; - - } - return pi; - } - } - From f7096adc5010f7285f3129f84a86d23a45a1ba41 Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:26:50 +0530 Subject: [PATCH 4/9] Delete Naive.java --- Naive.java | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 Naive.java diff --git a/Naive.java b/Naive.java deleted file mode 100644 index 01cf3e6..0000000 --- a/Naive.java +++ /dev/null @@ -1,40 +0,0 @@ -package Algorithms; -import java.util.*; -public class Naive -{ - public static void Naivesearch(String pattern, String givenstr) - { - int m = pattern.length(); - int n = givenstr.length(); - int flag=0,i=0; - for (i = 0; i <= n - m; i++) - { - int j; - - //For current index i, check for pattern match - for (j = 0; j < m; j++) - if (givenstr.charAt(i + j) != pattern.charAt(j)) - break; - - if (j == m) {// if pattern found in the given string - flag=1; - } - } - if(flag==1) - System.out.println("Pattern found"); - else - System.out.println("Pattern not found"); - } - - public static void main(String[] args) - { - Scanner sc=new Scanner(System.in); - System.out.println("Enter the string: "); - String givenstr=sc.next(); - System.out.println("Enter the Pattern to be matched: "); - String pattern = sc.next(); - Naivesearch(pattern,givenstr); - } - } - - From 2444b20e7b906d34d1002d1afcf433555a7d3d5c Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:26:59 +0530 Subject: [PATCH 5/9] Delete Rabin_karp.java --- Rabin_karp.java | 71 ------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 Rabin_karp.java diff --git a/Rabin_karp.java b/Rabin_karp.java deleted file mode 100644 index 31381a9..0000000 --- a/Rabin_karp.java +++ /dev/null @@ -1,71 +0,0 @@ -package Algorithms; -public class Rabin_karp -{ - //number of characters in the input alphabet - public final static int d = 256; - - void RKsearch(String pat, String txt, int q) - { - int M = pat.length(); - int N = txt.length(); - int i, j,flag=0; - int p = 0; // hash value for pattern - int t = 0; // hash value for txt - int h = 1; - - for (i = 0; i < M-1; i++) - h = (h*d)%q; - - // Calculate the hash value of pattern and first window of text - for (i = 0; i < M; i++) - { - p = (d*p + pat.charAt(i))%q; - t = (d*t + txt.charAt(i))%q; - } - - // checking for pattern - for (i = 0; i <= N - M; i++) - { - - // Check the hash values of current window of text - // and pattern. If the hash values match then only - // check for characters on by one - if (p == t) - { - //checking each character - for (j = 0; j < M; j++) - { - if (txt.charAt(i+j) != pat.charAt(j)) - break; - } - - // if pattern exists in text - if (j == M) { - flag=1; - System.out.println("Pattern found at index " + i); } - } - - if ( i < N-M ) - { - t = (d*(t - txt.charAt(i)*h) + txt.charAt(i+M))%q; //calculating hash value - - //making t positive - if (t < 0) - t = (t + q); - } - } - if(flag==0) - System.out.println("Pattern not found"); - - } - - /* Driver program to test above function - public static void main(String[] args) - { - String txt = "Hello world"; - String pat = "ell"; - int q = 101; // A prime number - //RKsearch(pat, txt, q); - } */ - } - From 468c7d39ff4e1e609b116e81ed68b9847b5b8926 Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:27:13 +0530 Subject: [PATCH 6/9] Delete bleh.java --- bleh.java | 64 ------------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 bleh.java diff --git a/bleh.java b/bleh.java deleted file mode 100644 index b1009e5..0000000 --- a/bleh.java +++ /dev/null @@ -1,64 +0,0 @@ -package Algorithms; -import java.awt.*; -import java.awt.event.*; -import java.util.Scanner; -import java.awt.GraphicsConfiguration; -import java.awt.FlowLayout; -import javax.swing.*; - - -public class bleh -{ - static JTextField textfield1, textfield2; - static GraphicsConfiguration gc; - public static void main(String[] args) - { - Naive obj1 =new Naive(); - Rabin_karp obj2=new Rabin_karp(); - KMP obj3=new KMP(); - BMA obj4=new BMA(); - - JFrame frame= new JFrame(gc); - frame.getContentPane().setLayout(new FlowLayout()); - frame.setTitle("PATTERN MATCHING"); - frame.setSize(1000, 1000); - frame.setLocationRelativeTo(null); //Setting the window to the centre of the screen - frame.setVisible(true); - frame.setBackground(Color.cyan); - - textfield1 = new JTextField("Enter the String",20); - textfield2 = new JTextField("Enter the Pattern",20); - //textfield3 = new JTextField("Text field 3",10); - frame.getContentPane().add(textfield1); - frame.getContentPane().add(textfield2); - // f.getContentPane().add(textfield3); - frame.pack(); - - JButton n=new JButton("Naive"); - n.setBounds(100,100,140, 40); - JButton rk=new JButton("Rabin Karp"); - rk.setBounds(100,100,140, 40); - JButton kmp=new JButton("Knuth Morris Pratt"); - kmp.setBounds(100,100,140, 40); - JButton bma=new JButton("Boyer Moore"); - bma.setBounds(100,100,140, 40); - - frame.add(n); - frame.add(rk); - frame.add(kmp); - frame.add(bma); - - frame.validate(); - - Scanner sc=new Scanner(System.in); - String givenstr= textfield1.getText(); - String pattern = textfield2.getText(); - - n.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - obj1.Naivesearch(pattern, givenstr); - } - }); -} -} From 8e135b2aa84ca0bfe4b4ad31e384fc9c3fa17919 Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Sat, 16 Nov 2019 14:27:47 +0530 Subject: [PATCH 7/9] Add files via upload --- BMA.java | 76 ++++++++++++++++++++ Execute.java | 46 ++++++++++++ KMP.java | 63 ++++++++++++++++ Naive.java | 45 ++++++++++++ Rabin_karp.java | 81 +++++++++++++++++++++ bleh.java | 187 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 498 insertions(+) create mode 100644 BMA.java create mode 100644 Execute.java create mode 100644 KMP.java create mode 100644 Naive.java create mode 100644 Rabin_karp.java create mode 100644 bleh.java diff --git a/BMA.java b/BMA.java new file mode 100644 index 0000000..f365e7b --- /dev/null +++ b/BMA.java @@ -0,0 +1,76 @@ +package Algorithms; +public class BMA +{ + String zx=" "; + /*public static void main(String[] args) + { + //(BoyerMoore("Is the pattern a substring?", "substr")); + }*/ + + public boolean BoyerMoore(String T, String P) + { + int flag=0,pos=0; + int i = P.length() -1; + int j = P.length() -1; + do + { + if (P.charAt(j) == T.charAt(i)) + { + if (j == 0) + { + pos=i; + flag=1;// pattern found + System.out.println("Pattern found at position: "+ pos); + zx=zx+" "+pos; + break; + + } + else + { + i--; + j--; + } + } + else + { + i = i + P.length() - min(j, 1+last(T.charAt(i), P)); + j = P.length()-1; + } + } while(i <= T.length()-1); + + if(flag==1) + { + System.out.println("Pattern found at position: "+ pos); + return true; + } + else { + System.out.println("Pattern not found"); + return false; + } + } + // Returns index of last occurrence of character in pattern. + + public static int last(char c, String P) + { + for (int i=P.length()-1; i>=0; i--) + { + if (P.charAt(i) == c) + { + return i; + } + } + return -1; + } + + + // Returns the minimum of two integers. + public static int min(int a, int b) + { + if (a < b) + return a; + else if (b < a) + return b; + else + return a; + } +} \ No newline at end of file diff --git a/Execute.java b/Execute.java new file mode 100644 index 0000000..833a9ef --- /dev/null +++ b/Execute.java @@ -0,0 +1,46 @@ +package Algorithms; +import java.util.*; +import java.lang.*; +public class Execute +{ + public static void main(String args[]) + { + Naive obj1 =new Naive(); + Rabin_karp obj2=new Rabin_karp(); + KMP obj3=new KMP(); + BMA obj4=new BMA(); + + Scanner sc=new Scanner(System.in); + System.out.println("Enter the string: "); + String givenstr=sc.nextLine(); + System.out.println("Enter the Pattern to be matchAed: "); + String pattern = sc.next(); + + while(true) { + System.out.println("CHOOSE A STRING MATCHING ALGORITHM: /n1.Naive /n2.Rabin Karp /n3.Knuth Moris Patt /n4.Boyer Moore /n5.Exit "); + int choice=sc.nextInt(); + + switch(choice) + { + case 1: obj1.Naivesearch(pattern, givenstr); + break; + + case 2: int q=101; + obj2.RKsearch(pattern,givenstr,q); + break; + + case 3:obj3.KMPmatcher(givenstr,pattern); + break; + case 4:obj4.BoyerMoore(givenstr,pattern); + break; + + case 5: System.exit(0); + default:System.out.println("Invalid Input"); + + } + + } + + } + +} diff --git a/KMP.java b/KMP.java new file mode 100644 index 0000000..5988abc --- /dev/null +++ b/KMP.java @@ -0,0 +1,63 @@ +package Algorithms; +public class KMP +{ + String zx=" "; + /* public static void main(String[] args) { + final String givenstr = "AAAAABAAABA"; //This is the full string + final String pattern= "AAAA"; //This is the substring that we want to find + KMPmatcher(haystack, needle); + }*/ + + boolean KMPmatcher(String givenstr, String pattern) { + int m = givenstr.length(); + int n = pattern.length(); + int flag=0; + int[] pi = computePrefixFunction(pattern); + int q = 0; + for (int i = 0; i < m; i++) { + while (q > 0 && givenstr.charAt(i) != pattern.charAt(q)) { + q = pi[q - 1]; + } + + if (givenstr.charAt(i) == pattern.charAt(q)) { + q++; + } + + if (q == n) { + flag=1; + System.out.println("Pattern found at " + (i + 1 - n)); + q = pi[q - 1]; + zx=zx+" "+(i + 1 - n); + } + } + if(flag==0) { + System.out.println("Pattern not found"); + return false; + } + else { + return true; + } + } + + // return the prefix function + static int[] computePrefixFunction(final String P) { + final int n = P.length(); + final int[] pi = new int[n]; + pi[0] = 0; + int q = 0; + for (int i = 1; i < n; i++) { + while (q > 0 && P.charAt(q) != P.charAt(i)) { + q = pi[q - 1]; + } + + if (P.charAt(q) == P.charAt(i)) { + q++; + } + + pi[i] = q; + + } + return pi; + } + } + diff --git a/Naive.java b/Naive.java new file mode 100644 index 0000000..8a87b27 --- /dev/null +++ b/Naive.java @@ -0,0 +1,45 @@ +package Algorithms; +import java.util.*; +public class Naive +{ + int flag=0; + public boolean Naivesearch(String pattern, String givenstr) + { + int m = pattern.length(); + int n = givenstr.length(); + int i=0; + for (i = 0; i <= n - m; i++) + { + int j; + + //For current index i, check for pattern match + for (j = 0; j < m; j++) + if (givenstr.charAt(i + j) != pattern.charAt(j)) + break; + + if (j == m) {// if pattern found in the given string + flag=1; + } + } + if(flag==1) + { + System.out.println("Pattern present in the string"); + return true; + } + else { + System.out.println("Pattern not found"); + return false; + } + } + /*public static void main(String[] args) + { + Scanner sc=new Scanner(System.in); + System.out.println("Enter the string: "); + String givenstr=sc.next(); + System.out.println("Enter the Pattern to be matched: "); + String pattern = sc.next(); + Naivesearch(pattern,givenstr); + } */ + } + + diff --git a/Rabin_karp.java b/Rabin_karp.java new file mode 100644 index 0000000..7e2b866 --- /dev/null +++ b/Rabin_karp.java @@ -0,0 +1,81 @@ +package Algorithms; +public class Rabin_karp +{ + int flag=0; + String zx=" "; + //number of characters in the input alphabet + public final static int d = 256; + + boolean RKsearch(String pat, String txt, int q) + { + int M = pat.length(); + int N = txt.length(); + int i, j; + int p = 0; // hash value for pattern + int t = 0; // hash value for txt + int h = 1; + + for (i = 0; i < M-1; i++) + h = (h*d)%q; + + // Calculate the hash value of pattern and first window of text + for (i = 0; i < M; i++) + { + p = (d*p + pat.charAt(i))%q; + t = (d*t + txt.charAt(i))%q; + } + + // checking for pattern + for (i = 0; i <= N - M; i++) + { + + // Check the hash values of current window of text + // and pattern. If the hash values match then only + // check for characters on by one + if (p == t) + { + //checking each character + for (j = 0; j < M; j++) + { + if (txt.charAt(i+j) != pat.charAt(j)) + break; + } + + // if pattern exists in text + if (j == M) { + flag=1; + System.out.println("Pattern found at index " + i); + zx=zx+" "+i; + System.out.println(zx); + } + } + + if ( i < N-M ) + { + t = (d*(t - txt.charAt(i)*h) + txt.charAt(i+M))%q; //calculating hash value + + //making t positive + if (t < 0) + t = (t + q); + } + } + if(flag==0) { + System.out.println("Pattern not found"); + return false; + } + else { + return true; + } + + } + + /* Driver program to test above function + public static void main(String[] args) + { + String txt = "Hello world"; + String pat = "ell"; + int q = 101; // A prime number + //RKsearch(pat, txt, q); + } */ + } + diff --git a/bleh.java b/bleh.java new file mode 100644 index 0000000..9f75c8c --- /dev/null +++ b/bleh.java @@ -0,0 +1,187 @@ +package Algorithms; +import java.awt.*; +import java.awt.event.*; +import java.util.Scanner; +import java.awt.GraphicsConfiguration; +import java.awt.FlowLayout; +import javax.swing.*; + + +public class bleh +{ + static JTextField txt1, txt2; + static GraphicsConfiguration gc; + public static void main(String[] args) + { + + Naive obj1 =new Naive(); + Rabin_karp obj2=new Rabin_karp(); + KMP obj3=new KMP(); + BMA obj4=new BMA(); + JPanel top=new JPanel(); + top.setLayout(new GridBagLayout()); + + GridBagConstraints c = new GridBagConstraints(); + + JFrame frame= new JFrame(gc); + frame.getContentPane().setLayout(new FlowLayout()); + frame.setTitle("PATTERN MATCHING"); + frame.setSize(1000, 1000); + frame.setLocationRelativeTo(null); //Setting the window to the centre of the screen + frame.setVisible(true); + frame.setBackground(Color.cyan); + + + + + txt1 = new JTextField("Enter the String",20); + txt2 = new JTextField("Enter the Pattern",20); + //textfield3 = new JTextField("Text field 3",10); + //frame.getContentPane().add(textfield1); + // frame.getContentPane().add(textfield2); + // f.getContentPane().add(textfield3); + + + JButton n=new JButton("Naive"); + n.setBounds(100,100,140, 40); + JButton rk=new JButton("Rabin Karp"); + rk.setBounds(100,100,140, 40); + JButton kmp=new JButton("Knuth Morris Pratt"); + kmp.setBounds(100,100,140, 40); + JButton bma=new JButton("Boyer Moore"); + bma.setBounds(100,100,140, 40); + JButton res=new JButton("Reset"); + res.setBounds(100,100,140, 40); + + + JLabel op1=new JLabel(" "); + JLabel op2=new JLabel(" "); + JLabel op3=new JLabel(" "); + JLabel op4=new JLabel(" "); + + c.gridx=1;//TEXT FIELDS + c.gridy=1; + top.add(txt1, c); + c.gridx=2; + c.gridy=1; + top.add(txt2, c); + + c.gridx=1; //BUTTONS + c.gridy=2; + c.fill=c.HORIZONTAL; + c.insets = new Insets(3,3,3,3); + + top.add(n, c); + c.gridx=1; + c.gridy=3; + top.add(rk, c); + c.gridx=1; + c.gridy=4; + top.add(kmp, c); + c.gridx=1; + c.gridy=5; + top.add(bma, c); + c.gridx=1; + c.gridy=6; + c.fill=c.NONE; + c.gridy=GridBagConstraints.RELATIVE; + top.add(res, c); + + + c.gridx=2;//LABELS + c.gridy=2; + top.add(op1, c); + c.gridx=2; + c.gridy=3; + top.add(op2, c); + c.gridx=2; + c.gridy=4; + top.add(op3, c); + c.gridx=2; + c.gridy=5; + top.add(op4, c); + + + frame.add(top); + frame.validate(); + + Scanner sc=new Scanner(System.in); + String givenstr= txt1.getText(); + String pattern = txt2.getText(); + + n.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + op1.setText(" "); + String x=txt1.getText(); + String y=txt2.getText(); + boolean f =obj1.Naivesearch(y, x); + if(f) + op1.setText("Pattern found in the string"); + else + op1.setText("Pattern not found in the string"); + + } + }); + res.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + op1.setText(" "); + op2.setText(" "); + op3.setText(" "); + op4.setText(" "); + obj2.zx=" "; + obj3.zx=" "; + obj4.zx=" "; + } + }); + + rk.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + op2.setText(" "); + String x=txt1.getText(); + String y=txt2.getText(); + String w=obj2.zx; + int q=101; + + boolean f = obj2.RKsearch(y,x,q); + if(f) + op2.setText("Pattern found in the string at: "+ obj2.zx ); + else + op2.setText("Pattern not found in the string"); + + } + }); + + kmp.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + op3.setText(" "); + String x=txt1.getText(); + String y=txt2.getText(); + String w=obj3.zx; + + boolean f = obj3.KMPmatcher(x,y); + if(f) + op3.setText("Pattern found in the string at: " + obj3.zx); + else + op3.setText("Pattern not found in the string"); + + } + }); + + bma.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + op4.setText(" "); + String x=txt1.getText(); + String y=txt2.getText(); + + boolean f = obj4.BoyerMoore(x,y); + String w=obj4.zx; + if(f) + op4.setText("Pattern found in the string at: "+ obj4.zx); + else + op4.setText("Pattern not found in the string"); + + } + }); + frame.pack(); +} +} \ No newline at end of file From fefcf5f0cbe92d8184ef02adaa618f24916c0481 Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Mon, 26 Apr 2021 07:14:05 +0530 Subject: [PATCH 8/9] Create README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..175e039 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Advanced Algorithm Project +## Search Algorithms Visualizer in Java Swing +Algorithms like +- Naive Bayes +- Knuth,Morris & Pratt +- Boyer Moore +- Rabin Karp +Are demonstrated From 978349443e18bbfa863c02cd5951e4810c9aa28f Mon Sep 17 00:00:00 2001 From: Simrankumaran <54710907+Simrankumaran@users.noreply.github.com> Date: Mon, 26 Apr 2021 07:15:48 +0530 Subject: [PATCH 9/9] Update and rename bleh.java to index.java --- bleh.java => index.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename bleh.java => index.java (95%) diff --git a/bleh.java b/index.java similarity index 95% rename from bleh.java rename to index.java index 9f75c8c..7ecdd19 100644 --- a/bleh.java +++ b/index.java @@ -7,7 +7,7 @@ import javax.swing.*; -public class bleh +public class index { static JTextField txt1, txt2; static GraphicsConfiguration gc; @@ -184,4 +184,4 @@ public void actionPerformed(ActionEvent e) { }); frame.pack(); } -} \ No newline at end of file +}