JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

Showing posts with label Searching. Show all posts
Showing posts with label Searching. Show all posts

Explain Searching?

11:07 PM
Searching Searching is the process of finding some particular element in the list. If the element is present in the list, then the process is called successful and the process returns the location of that element, otherwise the search is called unsuccessful. There are two popular search methods that are widely used in order to search some item into the list. However, choice of the algorithm depends upon the arrangement of the list. Linear Search Binary Search Linear Search Linear search is the simplest search algorithm and often called sequential search. In this type of searching, we simply traverse the list completely and match each element of the list with the item whose location is to be found. If the match found then location of the item is returned otherwise the algorithm return NULL. Linear search is mostly used to search an unordered list in which the items are not sorted. The algorithm of linear search is given as follows. Algorithm LINEAR_SEARCH(A, N, VAL)

.