This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//brute force algorithm | |
//string matching | |
import java.io.*; | |
import java.util.Scanner; | |
class Bruteforce{ | |
//called function | |
public static int bruteforce(String text,String tobematched){ | |
int length = text.length();//length of the text | |
int plength = tobematched.length();//length of the pattern; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class SelectionSort{ | |
static int i; | |
static int temp,element; | |
//selection sorting done here | |
public static void SelectionSort(int[] arr,int n){ | |
//while condtion to check the loop and increment | |
int smallest = arr[0]; | |
int init = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.Scanner; | |
class HashingTable{ | |
static String userchoice; | |
static int capacity; | |
static int array[]; | |
//constructor function called | |
public HashingTable(int capacity){ | |
this.capacity = nextPrime(capacity); |
NewerOlder