SS: Slice Search

67 downloads 10346 Views 244KB Size Report
... introduce in data structure for searching that are linear search and binary .... [2] Yashvant Kanetkar ,”Data Structures through C”Networks”, BPB. Publications.
International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 3, Issue 9, September 2013)

SS: Slice Search Harshika Rana1, Pritesh Upadhyaya2 1

Lecturer at Department of Bachelor of Computer Application, Parul Institute of Engineering & Technology, Vadodara, Gujarat, India 2Ass.Proff at Department of Master of Computer Application, Parul Institute of Engineering & Technology, Vadodara, Gujarat, India. II. RELATED WORK

Abstract— SS is an algorithm for efficient searching of an element from the list. Basically it uses modified binary search algorithm. That modification makes searching much more efficient as compare to simple binary search algorithm. That modification is rather then checking only middle position, SS is checking lower and high position as well. By checking three position simultaneously in the one iteration, the speed of searching an searching is increased than regular binary search algorithm.

Search: A search is the organized pursuit of information. Somewhere in a collection of documents, Web pages, and other sources, there is information that you want to find, but you have no idea where it is. There are mainly two types are introduce in data structure for searching that are linear search and binary search. Linear search: In Linear Search the list is searched sequentially and the position is returned if the key element to be searched is available in the list, otherwise -1 is returned. The search in Linear Search starts at the beginning of an array and move to the end, testing for a match at each item. All the elements preceding the search element are traversed before the search element is traversed. i.e. if the element to be searched is in position 10, all elements form 1-9.

Keywords—Search, Binary Search, Linear Search, Algorithm, Iteration, Time Complexity, Space Complexity, Upper bound , Lower bound.

I. INTRODUCTION This SS- Slice Search is mainly searching algorithm, which finds an element faster than regular binary search algorithm In this algorithm three elements are check simultaneously, therefore speed of searching an element is increased by double with comparison of regular binary search algorithm. In SS we take array of elements in sorted order and one element which we want to search. In initialization step we assign lower bound to variable low and upper bound to variable high. Then it will check first low and high position for element. If it founds the element it will display the position of the element in list, else it will compute mid position that is mid = (low + high )/ 2 and then check for mid position. If it founds the element it will display position of mid for searched element. Else it will do same procedure with new parameters. That is if searching element is less than element at mid position then it will have new parameters i.e low = 0th position and high = mid -1. If searching element is greater than element at mid then it will have new parameters i.e. low = mid+1 and high= upper bound. Thus, if found the element in the prescribed list then output will be “Search is successful with position” Else output will be “Search is unsuccessful"

Algorithm Input: Array with size, i as looping variable, pos for position, no that you want to search Output: Result of search Step:1 [Initialization] Pos=0 Step:2 for i=0 to i