ResearchBib Share Your Research, Maximize Your Social Impacts
Sign for Notice Everyday Sign up >> Login

A Search Algorithm ?My-Search? To Find Elements

Journal: International Journal of Science and Research (IJSR) (Vol.4, No. 4)

Publication Date:

Authors : ;

Page : 2540-2540

Keywords : MY-SEARCH; LINEAR SEARCH; TIME COMPLEXITY; EXECUTION;

Source : Downloadexternal Find it from : Google Scholarexternal

Abstract

THIS IS A ALGORITHM WHICH HAS THE SAME TIME COMPLEXITY AS THAT OF LINEAR SEARCH OF -O (n) -. BUT STILL IT IS BETTER THAN -LINEAR SEARCH- IN TERMS OF EXECUTION TIME. LET A [] BE THE ARRAY OF SOME SIZE N. IF THE ELEMENT WHICH WE WANT TO SEARCH IS AT ANY POSITION BEFORE -N/2- THAN -MYSEARCH AND LINEAR-SEARCH- BOTH WILL HAVE EXECUTION TIME, BUT THE MAGIC HAPPENS WHEN THE SEARCH ELEMENT IS AFTER -N/2- POSITION. SUPPOSE THE ELEMENT WANT TO SEARCH IS AT Nth POSITION, THEN USING THE LINEAR SEARCH WILL FIND THE ELEMENT AFTER Nth ITERATION, BUT USING -MY-SEARCH- WE CAN SEARCH THE ELEMENT AFTER 1ST ITERATION ITESELF. ELEMENTS IN (N-i) TH POSITION CAN BE FOUND IN THE (i+1) TH ITERATION i. e, SUPPOSE SIZE IS 1000 THAN ELEMENT IN 1000TH POSITION CAN BE FOUND IN 1ST ITERATION, SIMILARLY 999 IN 2ND ITERATION AND PROCESS GOES ON LIKE THIS.

Last modified: 2021-06-30 21:44:39