Skip to content

Linear Search, Binary Search, Binary Search with Recursion for humans ๐ŸŒช๏ธ

License

Notifications You must be signed in to change notification settings

akshaybahadur21/Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Searching Algorithms ๐ŸŒช๏ธ

This code helps you to understand the different Searching algorithms. The sorting algorithms depicted in this code are:

  1. Linear Search
  2. Binary Search
  3. Binary Search with recursion

Code Requirements ๐Ÿฆ„

The example code is in Java (version 1.8 or higher will work).

Description ๐Ÿƒ

In computer science, a search algorithm is any algorithm which solves the Search problem, namely, to retrieve information stored within some data structure, or calculated in the search space of a problem domain. Examples of such structures include but are not limited to a Linked List, an Array data structure, or a Search tree. The appropriate search algorithm often depends on the data structure being searched, but also on any a priori knowledge about the data.

Search algorithms can be classified based on their mechanism of searching. Linear search algorithms check every record for the one associated with a target key in a linear fashion.[3][4] Binary, or half interval searches, repeatedly target the center of the search structure and divide the search space in half.

For more information, see

Results ๐Ÿ“Š

switch(ch)
		{
			case 1:
				LinearSearch(a,n,num);
				break;
			case 2:
				BinarySearch(a,n,num);
				break;
			case 3:
				int first=0;
				int last=n;
				BinarySearchRec(a,n,num,first,last);
				break;
		}

You can select any algorithm from the list and then enter an array. Following that, enter a term that you want to search in the list.

Execution ๐Ÿ‰

To compile the code, simply run the javac Search.java. To run the code, type java Search

javac Search.java
java Search

About

Linear Search, Binary Search, Binary Search with Recursion for humans ๐ŸŒช๏ธ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages