Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Madhivarman's full-sized avatar
🏠
Working from home

Madhivarman Madhivarman

🏠
Working from home
  • Pluto7
  • Bengaluru
View GitHub Profile
@Madhivarman
Madhivarman / Bruteforce.java
Last active May 20, 2022 05:16
String Pattern matching using BruteForce Algorithm
//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;
@Madhivarman
Madhivarman / SelectionSort.java
Created September 5, 2017 14:47
Selection Sort using single Loop
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;
@Madhivarman
Madhivarman / HashingTable.java
Last active September 5, 2017 14:19
Hashing Table concept implemented in java
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);