Java Program to Solve Set Cover Problem assuming at max 2 Elements in a Subset

This is a java program to solve set cover problem. The set covering problem (SCP) is a classical question in combinatorics, computer science and complexity theory.Given a set of elements \{1,2,…,m\} (called the universe) and a set S of n sets whose union equals the universe, the set cover problem is to identify the smallest … Read more

advertisement

Java Program to Implement the String Search Algorithm for Short Text Sizes

This is a java program to search string using simple algorithm BoyerMoore. Here is the source code of the Java Program to Implement the String Search Algorithm for Short Text Sizes. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.Scanner; class BoyerMoore{ private … Read more

advertisement

Java Program to Repeatedly Search the Same Text (such as Bible by building a Data Structure)

This is a java program to repeatedly search a string from the sample string. Here is the source code of the Java Program to Repeatedly Search the Same Text (such as Bible by building a Data Structure). The Java program is successfully compiled and run on a Windows system. The program output is also shown … Read more

advertisement

Java Program to Implement Aho-Corasick Algorithm for String Matching

This is a java program to implement Aho-Corasick Algorithm. It is a kind of dictionary-matching algorithm that locates elements of a finite set of strings (the “dictionary”) within an input text. It matches all patterns simultaneously. The complexity of the algorithm is linear in the length of the patterns plus the length of the searched … Read more

advertisement

Java Program to Implement the Program Used in grep/egrep/fgrep

This is a java program to implement grep linux command. Here is the source code of the Java Program to Implement the Program Used in grep/egrep/fgrep. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.Scanner;import java.util.regex.Matcher;import java.util.regex.Pattern; public class GrepCommandImplementation{ … Read more

advertisement

Java Program to Perform Naive String Matching

This is a java program to perform Naive String matching algorithm. Here is the source code of the Java Program to Perform Naive String Matching. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.Scanner; public class StringSearchUsingNaiveMethod{ private final int BASE; private int[] … Read more

advertisement

Java Program to Perform Finite State Automaton based Search

This is a java program to perform search using DFA. Here is the source code of the Java Program to Perform Finite State Automaton based Search. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.Scanner; public class SearchStringUsingDFA{ public static final int NO_OF_CHARS … Read more

advertisement

Java Program to Perform String Matching Using String Library

This is a java program to perform search using string library. Here is the source code of the Java Program to Perform String Matching Using String Library. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.Scanner; public class StringSearchUsingStrLib{ public static void main(String[] … Read more

advertisement

Java Program to Implement String Matching Using Vectors

This is a java program to perform search using Vectors. Here is the source code of the Java Program to Implement String Matching Using Vectors. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.Scanner;import java.util.Vector; public class StringSearchUsingVectors{ public static void main(String[] args) … Read more

advertisement

Java Program to Use Dynamic Programming to Solve Approximate String Matching

This is a java program to solve approximate string matching using dynamic programming. Here is the source code of the Java Program to Use Dynamic Programming to Solve Approximate String Matching. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.  package com.sanfoundry.setandstring; import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.