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 Searching based on Locality of Reference

This is a java program to perform searching based on locality of refernce. The Locality of Reference principle says that if an element of a list is accessed it might also be accessed in near future. So we store it to the front of the list. Here is the source code of the Java Program … Read more

advertisement

Java Program to Implement a Binary Search Algorithm for a Specific Search Sequence

This is a java program to search sequence using binary search. This is a simple extension of binary search algorithm to find an element. Here is the source code of the Java Program to Implement a Binary Search Algorithm for a Specific Search Sequence. The Java program is successfully compiled and run on a Windows … Read more

advertisement

Java Program to Compare Binary and Sequential Search

This is a java program to compare Binary Search and Linear Search algorithms. Following class provides the time required to search an element for both the algorithms Here is the source code of the Java Program to Compare Binary and Sequential Search. The Java program is successfully compiled and run on a Windows system. The … Read more

advertisement

Java Program to Find Second Smallest of n Elements with Complexity Constraint

This is a java program to find the second smallest element with given complexity. Complexity here is minimum space constraints. Inplace sorting and returning second element help achieving the space constraints. Here is the source code of the Java Program to Find Second Smallest of n Elements with Given Complexity Constraint. The Java program is … Read more

advertisement

Java Program to Perform Searching using Self-Organizing Lists

This is a java program to search an element using Self Organizing lists. A self-organizing list is a list that reorders its elements based on some self-organizing heuristic to improve average access time. The aim of a self-organizing list is to improve efficiency of linear search by moving more frequently accessed items towards the head … Read more

advertisement

Java Program to Perform Uniform Binary Search

This is a java program to perform uniform binary search technique. It uses a lookup table to update a single array index, rather than taking the midpoint of an upper and a lower bound on each iteration; therefore, it is optimized for architectures (such as Knuth’s MIX) on which a table look-up is generally faster … Read more

advertisement

Java Program to Find Minimum Element in an Array using Linear Search

This is a java program to find the minimum element of the sequence using the technique of linear search. First we assign min equal to the first element of the sequence, then we go on exploring each element of the sequence and compare it with the min element, if less we update min. Here is … Read more

advertisement

Java Program to Find Median of Two Arrays of Different Sizes

This is a java program to find the median from two different array. To do so we merge the two lists and then sort them, after that we find the median of the sequence. If the total number of elements (N) is odd median is the N/2th element, if its even (N-1/2 + N/2)/2th element. … Read more

advertisement

Java Program to Find Maximum Element in an Array using Binary Search

This is a java program to find the maximum element using binary search technique. Binary search requires sequence to be sorted. We return the last element of the sequence, which is maximum. Here is the source code of the Java Program to Find Maximum Element in an Array using Binary Search. The Java program is … 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.