SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
http://www.iaeme.com/IJCET/index.asp 40 editor@iaeme.com
International Journal of Computer Engineering & Technology (IJCET)
Volume 7, Issue 5, Sep–Oct 2016, pp. 40–55, Article ID: IJCET_07_05_006
Available online at
http://www.iaeme.com/ijcet/issues.asp?JType=IJCET&VType=7&IType=5
Journal Impact Factor (2016): 9.3590 (Calculated by GISI) www.jifactor.com
ISSN Print: 0976-6367 and ISSN Online: 0976–6375
© IAEME Publication
ODD EVEN BASED BINARY SEARCH
Karthick S
MCA Scholar, Department of Computer Science,
Christ University, Bengaluru, Karnataka, India
ABSTRACT
Searching is one of the important operations in computer science. Retrieving information from
huge databases takes a lot of processing time to get the results. The user has to wait till the completion
of processing to find whether search is successful or not. In this research paper, it provides a detailed
study of Binary Search and how the time complexity of Binary Search can be reduced by using Odd
Even Based Binary Search Algorithm, which is an extension of classical binary search strategy. The
worst case time complexity of Binary Search can be reduced from O(log2N) to O(log2(N-M)) where
N is total number of items in the list and M is total number of even numbers if search KEY is ODD
or M is total number of odd numbers if search KEY is EVEN. Whenever the search KEY is given, first
the KEY is determined whether it is odd or even. If given KEY is odd, then only odd numbers from
the list are searched by completely ignoring list of even numbers. If given KEY is even, then only
even numbers from the list are searched by completely ignoring list of odd numbers. The output of
Odd Even Based algorithm is given as an input to Binary Search algorithm. Using Odd Even Based
Binary Search algorithm, the worst case performances in Binary Search algorithm are converted
into best case or average case performance. Therefore, it reduces total number of comparisons, time
complexity and usage of various computer resources.
Key words: Algorithm Efficiency, Binary Search, Odd Even Based Binary Search, Searching, Time
Complexity.
Cite this Article: Karthick S, Odd Even Based Binary Search. International Journal of Computer
Engineering and Technology, 7(5), 2016, pp. 40–55.
http://www.iaeme.com/ijcet/issues.asp?JType=IJCET&VType=7&IType=5
1. INTRODUCTION
Searching techniques are widely used to retrieve the information. There are various algorithms developed
for searching. The most commonly used searching algorithms are Linear Search and Binary Search. The
worst case time complexity of Linear Search is O(N) and Binary Search is O(log2N) [1], [2]. In this research
paper, a new algorithm proposed having worst case time complexity of O (log2 (N-M)). The running time of
an algorithm is called time complexity. The time complexity of an existing Binary Search algorithm reduced
by using Odd Even Based Binary Search Algorithm. The output of Odd Even Based Algorithm is given as
an input to Binary Search Algorithm.
The rest of the research paper is organized as; Section 2 describes the related work. Section 3 describes
proposed algorithm and the way in which it can be implemented. Section 4 describes the performance
analysis of Binary Search, Odd Even Based Binary Search, test results and conclusion of the paper.
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 41 editor@iaeme.com
2. RELATED WORK
Linear Search is one of the simplest searching techniques which does not expect the data to be arranged in
specific order [1]. In linear search, searching operation begins by comparing the key with each and every
element one by one from the beginning to end. If the search is successful, then either the element or its index
shall be returned [1], [2]. The best case time complexity of linear search is O(1) when the search KEY is
located in the beginning of the list, average case time complexity is O((N+1)/2) and worst case time
complexity is O(N) [1], [2]. Linear Search becomes inefficient, when key has to be searched in large list of
data items. If the element is not present or present at the end of the list then, very high number of comparisons
are required and which is very much time consuming task [1]. Nitin Arora et al. [3] proposed Two Way
Linear Search, in which there are two pointers used, pointing to beginning and end of the list. The beginning
pointer is incremented and end pointer is decremented every step to find the search key in the list. It reduces
the time complexity to some extent. The main disadvantages of this method are, there is a need of maintaining
multiple pointers inside linear search algorithm and the time complexity is reduced if and only if key has to
be searched is located after the middle of the array. Alwin Francis et al. [4] proposed Modulo Ten Search –
An Alternative to Linear Search, in which to find search key in the list, the remainder of that key divided by
10 is taken and searching is initiated only in that part of the list. In order to implement this, based on the
maximum length of the digit in the list, multiple lists are maintained. The main disadvantage of this method
is, there is a need of maintaining multiple lists based on the maximum length of the digit in the list which
increases space complexity. All these algorithms provide less efficient results when compared to Binary
Search. In Binary Search, the elements first have to be sorted either in ascending or descending order. The
list is divided into two equal halves The search KEY is compared with middle element of the list, if middle
element is equal to key, then either the element or its index is returned or if key is greater than middle element
then entire left sub array is ignored and only right subarray will be searched by changing variables
appropriately [1], [2]. Parveen Kumar [5] proposed Quadratic Search: A New and Fast Searching Algorithm,
in which the middle element, 1/4th of the element and 3/4th
of the element has to be calculated. Then, the
search key is compared with mid value, if it matches, then it is returned or else the same process continued.
The main disadvantages of this approach are, there is a need of maintaining multiple pointers inside the
binary search algorithm and it increases overhead in calculating complex calculations. The main
disadvantage of all these algorithms is, even though the search key is ODD, the searching is done for EVEN
numbers. Similarly, if the search key is EVEN searching is done for ODD numbers. Thereby, it increases
running time of an algorithm, delay in searching and wastage of computer resources.
3. ODD EVEN BASED BINARY SEARCH ALGORITHM
Generally, the list of elements are combination of odd numbers and even numbers. In Binary Search
whenever the search KEY is given, either the recursive method or iterative method of searching initiated.
But, even though the given KEY is odd, searching is done for even numbers. If given KEY is even, searching
is done for odd numbers. In the proposed method, whenever the KEY is given, first the KEY is determined
whether it is odd or even. If given KEY is odd, then only odd numbers from the list is searched by completely
ignoring list of even numbers. If given KEY is even, then only even numbers from the list is searched by
completely ignoring list of odd numbers. The sorted list is given as an input to Odd Even Based Search
Algorithm and it returns the list containing odd and even values either in ascending or descending order with
appropriate variables pointing to its corresponding index. The proposed method provides efficient results by
reducing time complexity and minimizing the usage of computer resources when the list contains
combination of even and odd numbers. If the list contains completely even or odd numbers, this algorithm
takes same time as in case of Binary Search. Since, integers can represent string of characters like names or
dates and specially formatted floating point numbers [4], so Odd Even Based Binary Search is not limited to
integers.
Karthick S
http://www.iaeme.com/IJCET/index.asp 42 editor@iaeme.com
3.1. ALGORITHM
Odd_Even_Based_Search (list[], N, count_odd, count_even)
Purpose : To classify sorted elements into list of odd numbers and even numbers.
Input : list[0...N-1] - the list of sorted elements
: N - the number of elements in the list
: count_odd - the count of odd numbers in the list
: count_even - the count of even numbers in the list
Output : A[0…N-1] - the list of classified elements
: odd_lb - the lower bound index of odd numbers
: odd_ub - the upper bound index of odd numbers
: even_lb - the lower bound index of even numbers
: even_ub - the upper bound index of even numbers
Step 1 : [Check whether the list contains combination of even numbers and odd numbers]
If count_odd = 0 OR count_even = 0 then
Print “Odd Even Based Search is not applicable.”
Goto Step 5
Endif
Step 2 : [Initialize the variables]
temp_odd – 1
temp_even N – count_even – 1
odd_lb temp_odd + 1
odd_ub count_odd – 1
even_lb temp_even + 1
even_ub N – 1
Step 3 : Repeat Step 4 for i 0 to N – 1
Step 4 : [Classifying each element into odd or even and storing it based on its index]
If (list[i] MOD 2 <> 0) then
temp_odd temp_odd + 1
A[temp_odd] list[i]
Else
temp_even temp_even + 1
A[temp_even] list[i]
EndIf
[End of Step 4 loop]
Step 5 : Exit
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 43 editor@iaeme.com
3.2. IMPLEMENTATION OF ODD EVEN BASED SEARCH ALGORITHM
Consider a list of 7 numbers in sorted order arranged in ascending order, given as an input to Odd Even
Based Search Algorithm, along with total number of even numbers in the list and total number of odd
numbers in the list.
Table 1 Classifying elements into odd or even and storing it based on its index
Steps Actions
Initial N = 7
count_odd = 4
count_even = 3
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
I. count_odd != 0 OR count_even != 0
II. Initialize
temp_odd = -1
temp_even = 7-3-1 = 3
odd_lb = -1 + 1 = 0
odd_ub = 4 – 1 = 3
even_lb = 3 + 1 = 4
even_ub = 7 – 1 = 6
A[]:
0 1 2 3 4 5 6
odd_lb odd_ub even_lb even_ub
-1 0 1 2 3 4 5 6
×
odd_lb temp_even
III. Repeat Step 4 for i = 0 to 6
IV. i=0
if(10%2==0) then
temp_even++
A[temp_even] = list[i]
A[]:
0 1 2 3 4 5 6
10
temp_even
i=1
if(23%2!=0) then
temp_odd++
A[temp_odd] = list[i]
A[]:
0 1 2 3 4 5 6
23 10
temp_odd temp_even
Karthick S
http://www.iaeme.com/IJCET/index.asp 44 editor@iaeme.com
i=2
if(34%2==0) then
temp_even++
A[temp_even] = list[i]
A[]:
0 1 2 3 4 5 6
23 10 34
temp_odd temp_even
i=3
if(47%2!=0) then
temp_odd++
A[temp_odd] = list[i]
A[]:
0 1 2 3 4 5 6
23 47 10 34
temp_odd temp_even
i=4
if(53%2!=0) then
temp_odd++
A[temp_odd] = list[i]
A[]:
0 1 2 3 4 5 6
23 47 53 10 34
temp_odd temp_even
i=5
if(66%2==0) then
temp_even++
A[temp_even] = list[i]
A[]:
0 1 2 3 4 5 6
23 47 53 10 34 66
temp_odd temp_even
i=6
if(81%2!=0) then
temp_odd++
A[temp_odd] = list[i]
A[]:
0 1 2 3 4 5 6
23 47 53 81 10 34 66
temp_odd temp_even
V. Exit
Final
Result
A[]:
odd_lb odd_ub even_lb even_ub
23 47 53 81 10 34 66
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 45 editor@iaeme.com
From the index odd_lb to odd_ub, all the odd elements are arranged in the ascending order. From the
index even_lb to even_ub, all the even elements are arranged in the ascending order. When searching KEY
is given, if KEY is odd then the function call is BinarySearch (A,KEY,odd_lb,odd_ub), only the elements
within odd_lb and odd_ub range is given, the remaining elements are completely ignored. Similarly, if KEY
is even then the function call is BinarySearch (A,KEY,even_lb,even_ub), only the elements within even_lb
and even_ub range is given, the remaining elements are completely ignored. Thereby it reduces total number
of function calls, time complexity and other computing resources.
For example, consider search KEY given is 34. In Odd Even Based Binary Search, first whether the KEY
is odd or even will be determined. Based on that, the appropriate variables are given in the function call.
Table 2 Find Key 34
Search Key = 34
Steps Binary Search Odd Even Based Binary Search
Input
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb ub
A[]:
0 1 2 3 4 5 6
23 47 53 81 10 34 66
odd_lb odd_ub even_lb even_ub
Initial lb=0 ub=6
if(34%2==0) then
even_lb=4
even_ub=6
Function
Call
BinarySearch
(list,key,lb,ub)
BinarySearch
(A,key,even_lb,even_ub)
1
lb=0 mid=3 ub=6
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb mid ub
lb=4 mid=5 ub=6
A[]:
0 1 2 3 4 5 6
23 47 53 81 10 34 66
lb mid ub
2
lb=0 mid=1 ub=2
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb mid ub
Karthick S
http://www.iaeme.com/IJCET/index.asp 46 editor@iaeme.com
3
lb=2 mid=2 ub=2
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb,mid,ub
Total
Function
Calls
3 1
Result Element Found Element Found
In classical binary search, to find KEY 34, the total number of function calls required are 3. But, using
Odd Even Based Binary Search Algorithm, the total number of function calls reduced from 3 to 1. It leads
to best case time complexity.
Table 3. Find Key 27
Search Key = 27
Steps Binary Search Odd Even Based Binary Search
Input
list[] :
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb ub
A[] :
0 1 2 3 4 5 6
23 47 53 81 10 34 66
odd_lb odd_ub even_lb even_ub
Initial lb=0 ub=6
if(27%2!=0) then
odd_lb=0
odd_ub=3
Function
Call
BinarySearch
(list,key,lb,ub)
BinarySearch
(A,key,odd_lb,odd_ub)
1
lb=0 mid=3 ub=6
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb mid ub
lb=0 mid=1 ub=3
A[]:
0 1 2 3 4 5 6
23 47 53 81 10 34 66
lb mid ub
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 47 editor@iaeme.com
2
lb=0 mid=1 ub=2
list[]:
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb mid ub
lb=0 mid=0 ub=0
A[] :
0 1 2 3 4 5 6
23 47 53 81 10 34 66
lb,mid,ub
3
lb=2 mid=2 ub=2
list[] :
0 1 2 3 4 5 6
10 23 34 47 53 66 81
lb,mid,ub
lb=1 ub=0
A[] :
0 1 2 3 4 5 6
23 47 53 81 10 34 66
ub,mid lb
if(ub<lb) then
Exit
4
lb=2 ub=1
list[] :
0 1 2 3 4 5 6
10 23 34 47 53 66 81
ub mid,lb
if(ub<lb) then
Exit
Total
Function
Calls
4 3
Result Element Not Found Element Not Found
In classical binary search, to find KEY 27 which is not present in the list, the total number of function
calls required are 4. But, using Odd Even Based Binary Search Algorithm, the total number of function calls
reduced from 4 to 3. It leads to average case time complexity.
4. PERFORMANCE ANALYSIS OF ODD EVEN BASED BINARY SEARCH
The time complexity of binary search algorithm in worst case is O (log2N). By using, Odd Even Based
Binary Search algorithm the time complexity reduced to O (log (N-M)) where M is total number of even
numbers if KEY is ODD or total number of odd numbers if KEY is EVEN. Therefore, ODD EVEN BASED
BINARY SEARCH ALGORITHM provides better results, if a list has combination of even and odd
numbers. The performance of Odd Even Based Binary Search and classical Binary Search were tested and
Karthick S
http://www.iaeme.com/IJCET/index.asp 48 editor@iaeme.com
implemented in MATLAB Version 7.10.0.499 (R2010a) for various input lengths 5000, 10000, 15000,
20000, 25000 and 30000. Both the searching algorithms are executed on machine with 64 bit Operating
System, Intel® Core i5-3210M CPU @ 2.50GHz, 2.50GHz installed memory (RAM) of 4GB. The running
time of an algorithm is measured by using Matlab Profiler. Profiler is used to measure total running time
taken by the algorithm, total number of function calls, total number of times particular line(s) of code has
been executed [6].
Table 4 CPU time for different lengths of input sequences
Key
Number of input
elements
Binary Search
(Running Time in
µs)
Odd Even Based
Search (Running
Time in µs)
22491 5000 5 0
66600 10000 6 4
133191 15000 16 5
139986 20000 9 5
3501 25000 9 2
16866 30000 9 2
Figure 1 CPU time taken for different input lengths
Table 5 Function calls to find the key in different length of input sequences
Key Number of input
elements
Binary Search (No
of function calls)
Odd Even Based
Search (No of
function calls)
22491 5000 13 1
66600 10000 14 9
133191 15000 14 11
139986 20000 15 11
3501 25000 14 6
16866 30000 15 4
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 49 editor@iaeme.com
Figure 2 Number of Function calls for different input lengths
4.1. TEST RESULTS
Consider an ordered array consisting of N elements (N = 5000 / 10000 / 15000 / 20000 / 25000 / 30000) and
the values stored in the array are uniformly distributed with the difference of 9. Thereafter both the searching
algorithms namely, Binary Search and Odd Even Based Binary Search are applied. The performance
measured using MATLAB Profiler and results are shown below.
Table 6 Test results with profile summary for various input length sequences
Type Array
Key
22491
Binary
Search
lb
1
ub
5000
list[]:
1 2 2500 2501 4999 5000
9 18 … 22500 22509 ... 44991 45000
lb ub
Figure 3. Profile summary to find key 22491 in Binary Search
Karthick S
http://www.iaeme.com/IJCET/index.asp 50 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
1
ub
2500
Key
66600
Binary
Search
lb
1
ub
10000
a[]:
1 2 2500 2501 4999 5000
9 27 … 44991 18 ... 44982 45000
odd_lb odd_ub even_lb even_ub
Figure 4. Profile summary to find key 22491 in Odd Even Based
Binary Search
list[]:
1 2 5000 5001 9999 10000
9 18 … 45000 45009 ... 89991 90000
lb ub
Figure 5. Profile summary to find key 66600 in Binary Search
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 51 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
5001
ub
10000
a[]:
1 2 5000 5001 9999 10000
9 27 … 89991 18 ... 88982 90000
odd_lb odd_ub even_lb even_ub
Figure 6. Profile summary to find key 66600 in Odd Even Based
Binary Search
Key
133191
Binary
Search
lb
1
ub
15000
list[]:
1 2 7500 7501 14999 15000
9 18 … 67500 67509 ... 134991 135000
lb ub
Figure 7. Profile summary to find key 133191 in Binary Search
Karthick S
http://www.iaeme.com/IJCET/index.asp 52 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
1
ub
7500
a[]:
1 2 7500 7501 14999 15000
9 27 … 134991 18 ... 134982 135000
odd_lb odd_ub even_lb even_ub
Figure 8. Profile summary to find key 133191 in Odd Even Based
Binary Search
Key
139986
Binary
Search
lb
1
ub
20000
list[]:
1 2 10000 10001 19999 20000
9 18 … 90000 90009 ... 179991 180000
lb ub
Figure 9. Profile summary to find key 139986 in Binary Search
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 53 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
10001
ub
20000
a[]:
1 2 10000 10001 19999 20000
9 27 … 179991 18 ... 179982 180000
odd_lb odd_ub even_lb even_ub
Figure 10. Profile summary to find key 139986 in Odd Even Based
Binary Search
Key
3501
Binary
Search
lb
1
ub
25000
list[]:
1 2 12500 12501 24999 25000
9 18 … 112500 112509 ... 224991 225000
lb ub
Figure 11. Profile summary to find key 3501 in Binary Search
Karthick S
http://www.iaeme.com/IJCET/index.asp 54 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
1
ub
12500
a[]:
1 2 12500 12501 24999 25000
9 27 … 224991 18 ... 224982 225000
odd_lb odd_ub even_lb even_ub
Figure 12. Profile summary to find key 3501 in Odd Even Based
Binary Search
Key
16866
Binary
Search
lb
1
ub
30000
list[]:
1 2 15000 15001 29999 30000
9 18 … 135000 135009 ... 269991 270000
lb ub
Figure 13. Profile summary to find key 16866 in Binary Search
Odd Even Based Binary Search
http://www.iaeme.com/IJCET/index.asp 55 editor@iaeme.com
Odd
Even
Based
Binary
Search
lb
15001
ub
30000
a[]:
1 2 15000 15001 29999 30000
9 27 … 269991 18 ... 269982 270000
odd_lb odd_ub even_lb even_ub
Figure 14. Profile summary to find key 16866 in Odd Even Based
Binary Search
5. CONCLUSION
Reducing the running time of any searching algorithms provide better results and it also helps to retrieve the
information quickly once the user submits the query. In this paper, a new algorithm is proposed and it
provides better result than the existing algorithm. The performance graphs, test results and function calls
clearly show Odd Even Based Binary Search Algorithm is better than classical Binary Search Algorithm.
ACKNOWLEDGEMENTS
I would like to express sincere gratitude to Prof. Joy Paulose, H.O.D the Department of Computer Science
Christ University, the Coordinator Dr. Rohini V. and Prof. Sumitra Binu for their valuable support,
encouragement and suggestions during the research work.
REFERENCES
[1] Chitra Ravi, Data Structures Using C. (Bangalore, Subhas Publishers, 2013).
[2] J. P. Tremblay and P. G. Sorenson, An introduction to data structures with applications (New
York, McGraw-Hill, 1976).
[3] N. Arora, G. Bhasin, and N. Sharma, Two way linear search algorithm, International Journal of
Computer Applications, 107(21), 2014, 6-8.
[4] Alwin Francis and Rajesh Ramachandran, Modulo Ten Search- An Alternative to Linear Search,
Proc. 2nd
IEEE Conf. on Process Automation, Control and Computing, Coimbatore, TamilNadu,
2011, 1-4.
[5] P. Kumar, Quadratic search: A new and fast searching algorithm (an extension of classical binary
search strategy), International Journal of Computer Applications, 65(14), 2013, 43–46.
[6] Profile, "Profile to improve performance," 1994. [Online]. Available:
http://in.mathworks.com/help/matlab/matlab_prog/profiling-for-improving-performance.html.

Mais conteúdo relacionado

Mais procurados

Sequential & binary, linear search
Sequential & binary, linear searchSequential & binary, linear search
Sequential & binary, linear searchmontazur420
 
linear search and binary search
linear search and binary searchlinear search and binary search
linear search and binary searchZia Ush Shamszaman
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm03446940736
 
Rahat &amp; juhith
Rahat &amp; juhithRahat &amp; juhith
Rahat &amp; juhithRj Juhith
 
Searching Techniques and Analysis
Searching Techniques and AnalysisSearching Techniques and Analysis
Searching Techniques and AnalysisAkashBorse2
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingHaitham El-Ghareeb
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sortingsajinis3
 
Binary search algorithm
Binary search algorithmBinary search algorithm
Binary search algorithmmaamir farooq
 
Data operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithmsData operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithmsAnushdika Jeganathan
 
Searching linear &amp; binary search
Searching linear &amp; binary searchSearching linear &amp; binary search
Searching linear &amp; binary searchnikunjandy
 
Binary search python
Binary search pythonBinary search python
Binary search pythonMaryamAnwar10
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...ijceronline
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithmstechnologygyan
 
Dsa – data structure and algorithms searching
Dsa – data structure and algorithms   searchingDsa – data structure and algorithms   searching
Dsa – data structure and algorithms searchingsajinis3
 

Mais procurados (20)

Sequential & binary, linear search
Sequential & binary, linear searchSequential & binary, linear search
Sequential & binary, linear search
 
linear search and binary search
linear search and binary searchlinear search and binary search
linear search and binary search
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
 
Non-Uniform Gap Distribution Library Sort
Non-Uniform Gap Distribution Library SortNon-Uniform Gap Distribution Library Sort
Non-Uniform Gap Distribution Library Sort
 
Rahat &amp; juhith
Rahat &amp; juhithRahat &amp; juhith
Rahat &amp; juhith
 
Searching Techniques and Analysis
Searching Techniques and AnalysisSearching Techniques and Analysis
Searching Techniques and Analysis
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Search methods
Search methodsSearch methods
Search methods
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic Sorting
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sorting
 
Binary search algorithm
Binary search algorithmBinary search algorithm
Binary search algorithm
 
Data operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithmsData operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithms
 
Ijcatr04051008
Ijcatr04051008Ijcatr04051008
Ijcatr04051008
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Searching linear &amp; binary search
Searching linear &amp; binary searchSearching linear &amp; binary search
Searching linear &amp; binary search
 
Binary search python
Binary search pythonBinary search python
Binary search python
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithms
 
Dsa – data structure and algorithms searching
Dsa – data structure and algorithms   searchingDsa – data structure and algorithms   searching
Dsa – data structure and algorithms searching
 

Destaque

Area
AreaArea
Areatotal
 
Why I Am Passionate About Perl
Why I Am Passionate About PerlWhy I Am Passionate About Perl
Why I Am Passionate About Perlbrian d foy
 
マネジメント3.0 新しいリーダーシップ概念
マネジメント3.0 新しいリーダーシップ概念マネジメント3.0 新しいリーダーシップ概念
マネジメント3.0 新しいリーダーシップ概念Stefan Nüsperling
 
Introduction to ISO 9001-2008
Introduction to ISO 9001-2008Introduction to ISO 9001-2008
Introduction to ISO 9001-2008AD Sarwar
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Swati Watve-Phadke
 
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DG
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DGLOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DG
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DGIAEME Publication
 
A stydy on employees job satisfaction in hassan co operative milk union ltd
A stydy on employees job satisfaction in hassan co operative milk union ltdA stydy on employees job satisfaction in hassan co operative milk union ltd
A stydy on employees job satisfaction in hassan co operative milk union ltdProjects Kart
 
Odd and even functions
Odd and even functionsOdd and even functions
Odd and even functionsDebra Wallace
 
The odd and even numbers (interactive slide project)
The odd and even numbers (interactive slide project)The odd and even numbers (interactive slide project)
The odd and even numbers (interactive slide project)Pepito Dalupe
 
1.2 subsets of integers dfs
1.2 subsets of integers dfs1.2 subsets of integers dfs
1.2 subsets of integers dfsFarhana Shaheen
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORSubash Sambath Kumar
 
Odd and Even nUMBERS
Odd and Even nUMBERSOdd and Even nUMBERS
Odd and Even nUMBERSSarah Tanti
 

Destaque (19)

Area
AreaArea
Area
 
Pr
PrPr
Pr
 
Cv Tomi Wiley James
Cv Tomi Wiley JamesCv Tomi Wiley James
Cv Tomi Wiley James
 
Treysta Social Media
Treysta Social MediaTreysta Social Media
Treysta Social Media
 
Соревнования по кихон-иппон кумитэ
Соревнования по кихон-иппон кумитэСоревнования по кихон-иппон кумитэ
Соревнования по кихон-иппон кумитэ
 
Why I Am Passionate About Perl
Why I Am Passionate About PerlWhy I Am Passionate About Perl
Why I Am Passionate About Perl
 
マネジメント3.0 新しいリーダーシップ概念
マネジメント3.0 新しいリーダーシップ概念マネジメント3.0 新しいリーダーシップ概念
マネジメント3.0 新しいリーダーシップ概念
 
Introduction to ISO 9001-2008
Introduction to ISO 9001-2008Introduction to ISO 9001-2008
Introduction to ISO 9001-2008
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DG
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DGLOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DG
LOAD FREQUENCY CONTROL IN TWO AREA NETWORK INCLUDING DG
 
Lice
Lice Lice
Lice
 
A stydy on employees job satisfaction in hassan co operative milk union ltd
A stydy on employees job satisfaction in hassan co operative milk union ltdA stydy on employees job satisfaction in hassan co operative milk union ltd
A stydy on employees job satisfaction in hassan co operative milk union ltd
 
Even and odd numbers
Even and odd numbersEven and odd numbers
Even and odd numbers
 
Odd and even functions
Odd and even functionsOdd and even functions
Odd and even functions
 
The odd and even numbers (interactive slide project)
The odd and even numbers (interactive slide project)The odd and even numbers (interactive slide project)
The odd and even numbers (interactive slide project)
 
1.2 subsets of integers dfs
1.2 subsets of integers dfs1.2 subsets of integers dfs
1.2 subsets of integers dfs
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
 
Odd and Even nUMBERS
Odd and Even nUMBERSOdd and Even nUMBERS
Odd and Even nUMBERS
 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 

Semelhante a ODD EVEN BASED BINARY SEARCH

ADSA orientation.pptx
ADSA orientation.pptxADSA orientation.pptx
ADSA orientation.pptxKiran Babar
 
A Comparative Study of Sorting and Searching Algorithms
A Comparative Study of Sorting and Searching AlgorithmsA Comparative Study of Sorting and Searching Algorithms
A Comparative Study of Sorting and Searching AlgorithmsIRJET Journal
 
Analysis and Comparative of Sorting Algorithms
Analysis and Comparative of Sorting AlgorithmsAnalysis and Comparative of Sorting Algorithms
Analysis and Comparative of Sorting Algorithmsijtsrd
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operationsbabuk110
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdfharamaya university
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxprakashvs7
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingThenmozhiK5
 
data_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxdata_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxMohammed472103
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sortingLavanyaJ28
 
DSA Lec 5+6(Search+Sort) (1).pdf
DSA Lec 5+6(Search+Sort) (1).pdfDSA Lec 5+6(Search+Sort) (1).pdf
DSA Lec 5+6(Search+Sort) (1).pdfMustafaJutt4
 
21CS32 DS Module 1 PPT.pptx
21CS32 DS Module 1 PPT.pptx21CS32 DS Module 1 PPT.pptx
21CS32 DS Module 1 PPT.pptxreddy19841
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 
Searching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxSearching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxDr. Madhuri Jawale
 

Semelhante a ODD EVEN BASED BINARY SEARCH (20)

ADSA orientation.pptx
ADSA orientation.pptxADSA orientation.pptx
ADSA orientation.pptx
 
A Comparative Study of Sorting and Searching Algorithms
A Comparative Study of Sorting and Searching AlgorithmsA Comparative Study of Sorting and Searching Algorithms
A Comparative Study of Sorting and Searching Algorithms
 
Analysis and Comparative of Sorting Algorithms
Analysis and Comparative of Sorting AlgorithmsAnalysis and Comparative of Sorting Algorithms
Analysis and Comparative of Sorting Algorithms
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
 
Analysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptxAnalysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptx
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
 
Chapter 11 ds
Chapter 11 dsChapter 11 ds
Chapter 11 ds
 
INDEX SORT
INDEX SORTINDEX SORT
INDEX SORT
 
searching
searchingsearching
searching
 
data_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptxdata_structure_Chapter two_computer.pptx
data_structure_Chapter two_computer.pptx
 
Searching_Sorting.pptx
Searching_Sorting.pptxSearching_Sorting.pptx
Searching_Sorting.pptx
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sorting
 
DSA Lec 5+6(Search+Sort) (1).pdf
DSA Lec 5+6(Search+Sort) (1).pdfDSA Lec 5+6(Search+Sort) (1).pdf
DSA Lec 5+6(Search+Sort) (1).pdf
 
Binary Sort
Binary SortBinary Sort
Binary Sort
 
21CS32 DS Module 1 PPT.pptx
21CS32 DS Module 1 PPT.pptx21CS32 DS Module 1 PPT.pptx
21CS32 DS Module 1 PPT.pptx
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 
Searching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptxSearching and Sorting Unit II Part I.pptx
Searching and Sorting Unit II Part I.pptx
 
Search Algprithms
Search AlgprithmsSearch Algprithms
Search Algprithms
 

Mais de IAEME Publication

IAEME_Publication_Call_for_Paper_September_2022.pdf
IAEME_Publication_Call_for_Paper_September_2022.pdfIAEME_Publication_Call_for_Paper_September_2022.pdf
IAEME_Publication_Call_for_Paper_September_2022.pdfIAEME Publication
 
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...IAEME Publication
 
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURSA STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURSIAEME Publication
 
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURSBROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURSIAEME Publication
 
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONSDETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONSIAEME Publication
 
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONSANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONSIAEME Publication
 
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINOVOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINOIAEME Publication
 
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...IAEME Publication
 
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMYVISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMYIAEME Publication
 
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...IAEME Publication
 
GANDHI ON NON-VIOLENT POLICE
GANDHI ON NON-VIOLENT POLICEGANDHI ON NON-VIOLENT POLICE
GANDHI ON NON-VIOLENT POLICEIAEME Publication
 
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...IAEME Publication
 
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...IAEME Publication
 
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...IAEME Publication
 
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...IAEME Publication
 
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...IAEME Publication
 
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...IAEME Publication
 
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...IAEME Publication
 
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...IAEME Publication
 
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENTA MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENTIAEME Publication
 

Mais de IAEME Publication (20)

IAEME_Publication_Call_for_Paper_September_2022.pdf
IAEME_Publication_Call_for_Paper_September_2022.pdfIAEME_Publication_Call_for_Paper_September_2022.pdf
IAEME_Publication_Call_for_Paper_September_2022.pdf
 
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
 
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURSA STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
 
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURSBROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
 
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONSDETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
 
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONSANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
 
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINOVOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
 
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
 
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMYVISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
 
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
 
GANDHI ON NON-VIOLENT POLICE
GANDHI ON NON-VIOLENT POLICEGANDHI ON NON-VIOLENT POLICE
GANDHI ON NON-VIOLENT POLICE
 
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
 
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
 
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
 
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
 
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
 
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
 
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
 
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
 
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENTA MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
 

Último

THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectssuserb6619e
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Último (20)

THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

ODD EVEN BASED BINARY SEARCH

  • 1. http://www.iaeme.com/IJCET/index.asp 40 editor@iaeme.com International Journal of Computer Engineering & Technology (IJCET) Volume 7, Issue 5, Sep–Oct 2016, pp. 40–55, Article ID: IJCET_07_05_006 Available online at http://www.iaeme.com/ijcet/issues.asp?JType=IJCET&VType=7&IType=5 Journal Impact Factor (2016): 9.3590 (Calculated by GISI) www.jifactor.com ISSN Print: 0976-6367 and ISSN Online: 0976–6375 © IAEME Publication ODD EVEN BASED BINARY SEARCH Karthick S MCA Scholar, Department of Computer Science, Christ University, Bengaluru, Karnataka, India ABSTRACT Searching is one of the important operations in computer science. Retrieving information from huge databases takes a lot of processing time to get the results. The user has to wait till the completion of processing to find whether search is successful or not. In this research paper, it provides a detailed study of Binary Search and how the time complexity of Binary Search can be reduced by using Odd Even Based Binary Search Algorithm, which is an extension of classical binary search strategy. The worst case time complexity of Binary Search can be reduced from O(log2N) to O(log2(N-M)) where N is total number of items in the list and M is total number of even numbers if search KEY is ODD or M is total number of odd numbers if search KEY is EVEN. Whenever the search KEY is given, first the KEY is determined whether it is odd or even. If given KEY is odd, then only odd numbers from the list are searched by completely ignoring list of even numbers. If given KEY is even, then only even numbers from the list are searched by completely ignoring list of odd numbers. The output of Odd Even Based algorithm is given as an input to Binary Search algorithm. Using Odd Even Based Binary Search algorithm, the worst case performances in Binary Search algorithm are converted into best case or average case performance. Therefore, it reduces total number of comparisons, time complexity and usage of various computer resources. Key words: Algorithm Efficiency, Binary Search, Odd Even Based Binary Search, Searching, Time Complexity. Cite this Article: Karthick S, Odd Even Based Binary Search. International Journal of Computer Engineering and Technology, 7(5), 2016, pp. 40–55. http://www.iaeme.com/ijcet/issues.asp?JType=IJCET&VType=7&IType=5 1. INTRODUCTION Searching techniques are widely used to retrieve the information. There are various algorithms developed for searching. The most commonly used searching algorithms are Linear Search and Binary Search. The worst case time complexity of Linear Search is O(N) and Binary Search is O(log2N) [1], [2]. In this research paper, a new algorithm proposed having worst case time complexity of O (log2 (N-M)). The running time of an algorithm is called time complexity. The time complexity of an existing Binary Search algorithm reduced by using Odd Even Based Binary Search Algorithm. The output of Odd Even Based Algorithm is given as an input to Binary Search Algorithm. The rest of the research paper is organized as; Section 2 describes the related work. Section 3 describes proposed algorithm and the way in which it can be implemented. Section 4 describes the performance analysis of Binary Search, Odd Even Based Binary Search, test results and conclusion of the paper.
  • 2. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 41 editor@iaeme.com 2. RELATED WORK Linear Search is one of the simplest searching techniques which does not expect the data to be arranged in specific order [1]. In linear search, searching operation begins by comparing the key with each and every element one by one from the beginning to end. If the search is successful, then either the element or its index shall be returned [1], [2]. The best case time complexity of linear search is O(1) when the search KEY is located in the beginning of the list, average case time complexity is O((N+1)/2) and worst case time complexity is O(N) [1], [2]. Linear Search becomes inefficient, when key has to be searched in large list of data items. If the element is not present or present at the end of the list then, very high number of comparisons are required and which is very much time consuming task [1]. Nitin Arora et al. [3] proposed Two Way Linear Search, in which there are two pointers used, pointing to beginning and end of the list. The beginning pointer is incremented and end pointer is decremented every step to find the search key in the list. It reduces the time complexity to some extent. The main disadvantages of this method are, there is a need of maintaining multiple pointers inside linear search algorithm and the time complexity is reduced if and only if key has to be searched is located after the middle of the array. Alwin Francis et al. [4] proposed Modulo Ten Search – An Alternative to Linear Search, in which to find search key in the list, the remainder of that key divided by 10 is taken and searching is initiated only in that part of the list. In order to implement this, based on the maximum length of the digit in the list, multiple lists are maintained. The main disadvantage of this method is, there is a need of maintaining multiple lists based on the maximum length of the digit in the list which increases space complexity. All these algorithms provide less efficient results when compared to Binary Search. In Binary Search, the elements first have to be sorted either in ascending or descending order. The list is divided into two equal halves The search KEY is compared with middle element of the list, if middle element is equal to key, then either the element or its index is returned or if key is greater than middle element then entire left sub array is ignored and only right subarray will be searched by changing variables appropriately [1], [2]. Parveen Kumar [5] proposed Quadratic Search: A New and Fast Searching Algorithm, in which the middle element, 1/4th of the element and 3/4th of the element has to be calculated. Then, the search key is compared with mid value, if it matches, then it is returned or else the same process continued. The main disadvantages of this approach are, there is a need of maintaining multiple pointers inside the binary search algorithm and it increases overhead in calculating complex calculations. The main disadvantage of all these algorithms is, even though the search key is ODD, the searching is done for EVEN numbers. Similarly, if the search key is EVEN searching is done for ODD numbers. Thereby, it increases running time of an algorithm, delay in searching and wastage of computer resources. 3. ODD EVEN BASED BINARY SEARCH ALGORITHM Generally, the list of elements are combination of odd numbers and even numbers. In Binary Search whenever the search KEY is given, either the recursive method or iterative method of searching initiated. But, even though the given KEY is odd, searching is done for even numbers. If given KEY is even, searching is done for odd numbers. In the proposed method, whenever the KEY is given, first the KEY is determined whether it is odd or even. If given KEY is odd, then only odd numbers from the list is searched by completely ignoring list of even numbers. If given KEY is even, then only even numbers from the list is searched by completely ignoring list of odd numbers. The sorted list is given as an input to Odd Even Based Search Algorithm and it returns the list containing odd and even values either in ascending or descending order with appropriate variables pointing to its corresponding index. The proposed method provides efficient results by reducing time complexity and minimizing the usage of computer resources when the list contains combination of even and odd numbers. If the list contains completely even or odd numbers, this algorithm takes same time as in case of Binary Search. Since, integers can represent string of characters like names or dates and specially formatted floating point numbers [4], so Odd Even Based Binary Search is not limited to integers.
  • 3. Karthick S http://www.iaeme.com/IJCET/index.asp 42 editor@iaeme.com 3.1. ALGORITHM Odd_Even_Based_Search (list[], N, count_odd, count_even) Purpose : To classify sorted elements into list of odd numbers and even numbers. Input : list[0...N-1] - the list of sorted elements : N - the number of elements in the list : count_odd - the count of odd numbers in the list : count_even - the count of even numbers in the list Output : A[0…N-1] - the list of classified elements : odd_lb - the lower bound index of odd numbers : odd_ub - the upper bound index of odd numbers : even_lb - the lower bound index of even numbers : even_ub - the upper bound index of even numbers Step 1 : [Check whether the list contains combination of even numbers and odd numbers] If count_odd = 0 OR count_even = 0 then Print “Odd Even Based Search is not applicable.” Goto Step 5 Endif Step 2 : [Initialize the variables] temp_odd – 1 temp_even N – count_even – 1 odd_lb temp_odd + 1 odd_ub count_odd – 1 even_lb temp_even + 1 even_ub N – 1 Step 3 : Repeat Step 4 for i 0 to N – 1 Step 4 : [Classifying each element into odd or even and storing it based on its index] If (list[i] MOD 2 <> 0) then temp_odd temp_odd + 1 A[temp_odd] list[i] Else temp_even temp_even + 1 A[temp_even] list[i] EndIf [End of Step 4 loop] Step 5 : Exit
  • 4. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 43 editor@iaeme.com 3.2. IMPLEMENTATION OF ODD EVEN BASED SEARCH ALGORITHM Consider a list of 7 numbers in sorted order arranged in ascending order, given as an input to Odd Even Based Search Algorithm, along with total number of even numbers in the list and total number of odd numbers in the list. Table 1 Classifying elements into odd or even and storing it based on its index Steps Actions Initial N = 7 count_odd = 4 count_even = 3 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 I. count_odd != 0 OR count_even != 0 II. Initialize temp_odd = -1 temp_even = 7-3-1 = 3 odd_lb = -1 + 1 = 0 odd_ub = 4 – 1 = 3 even_lb = 3 + 1 = 4 even_ub = 7 – 1 = 6 A[]: 0 1 2 3 4 5 6 odd_lb odd_ub even_lb even_ub -1 0 1 2 3 4 5 6 × odd_lb temp_even III. Repeat Step 4 for i = 0 to 6 IV. i=0 if(10%2==0) then temp_even++ A[temp_even] = list[i] A[]: 0 1 2 3 4 5 6 10 temp_even i=1 if(23%2!=0) then temp_odd++ A[temp_odd] = list[i] A[]: 0 1 2 3 4 5 6 23 10 temp_odd temp_even
  • 5. Karthick S http://www.iaeme.com/IJCET/index.asp 44 editor@iaeme.com i=2 if(34%2==0) then temp_even++ A[temp_even] = list[i] A[]: 0 1 2 3 4 5 6 23 10 34 temp_odd temp_even i=3 if(47%2!=0) then temp_odd++ A[temp_odd] = list[i] A[]: 0 1 2 3 4 5 6 23 47 10 34 temp_odd temp_even i=4 if(53%2!=0) then temp_odd++ A[temp_odd] = list[i] A[]: 0 1 2 3 4 5 6 23 47 53 10 34 temp_odd temp_even i=5 if(66%2==0) then temp_even++ A[temp_even] = list[i] A[]: 0 1 2 3 4 5 6 23 47 53 10 34 66 temp_odd temp_even i=6 if(81%2!=0) then temp_odd++ A[temp_odd] = list[i] A[]: 0 1 2 3 4 5 6 23 47 53 81 10 34 66 temp_odd temp_even V. Exit Final Result A[]: odd_lb odd_ub even_lb even_ub 23 47 53 81 10 34 66
  • 6. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 45 editor@iaeme.com From the index odd_lb to odd_ub, all the odd elements are arranged in the ascending order. From the index even_lb to even_ub, all the even elements are arranged in the ascending order. When searching KEY is given, if KEY is odd then the function call is BinarySearch (A,KEY,odd_lb,odd_ub), only the elements within odd_lb and odd_ub range is given, the remaining elements are completely ignored. Similarly, if KEY is even then the function call is BinarySearch (A,KEY,even_lb,even_ub), only the elements within even_lb and even_ub range is given, the remaining elements are completely ignored. Thereby it reduces total number of function calls, time complexity and other computing resources. For example, consider search KEY given is 34. In Odd Even Based Binary Search, first whether the KEY is odd or even will be determined. Based on that, the appropriate variables are given in the function call. Table 2 Find Key 34 Search Key = 34 Steps Binary Search Odd Even Based Binary Search Input list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb ub A[]: 0 1 2 3 4 5 6 23 47 53 81 10 34 66 odd_lb odd_ub even_lb even_ub Initial lb=0 ub=6 if(34%2==0) then even_lb=4 even_ub=6 Function Call BinarySearch (list,key,lb,ub) BinarySearch (A,key,even_lb,even_ub) 1 lb=0 mid=3 ub=6 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb mid ub lb=4 mid=5 ub=6 A[]: 0 1 2 3 4 5 6 23 47 53 81 10 34 66 lb mid ub 2 lb=0 mid=1 ub=2 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb mid ub
  • 7. Karthick S http://www.iaeme.com/IJCET/index.asp 46 editor@iaeme.com 3 lb=2 mid=2 ub=2 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb,mid,ub Total Function Calls 3 1 Result Element Found Element Found In classical binary search, to find KEY 34, the total number of function calls required are 3. But, using Odd Even Based Binary Search Algorithm, the total number of function calls reduced from 3 to 1. It leads to best case time complexity. Table 3. Find Key 27 Search Key = 27 Steps Binary Search Odd Even Based Binary Search Input list[] : 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb ub A[] : 0 1 2 3 4 5 6 23 47 53 81 10 34 66 odd_lb odd_ub even_lb even_ub Initial lb=0 ub=6 if(27%2!=0) then odd_lb=0 odd_ub=3 Function Call BinarySearch (list,key,lb,ub) BinarySearch (A,key,odd_lb,odd_ub) 1 lb=0 mid=3 ub=6 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb mid ub lb=0 mid=1 ub=3 A[]: 0 1 2 3 4 5 6 23 47 53 81 10 34 66 lb mid ub
  • 8. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 47 editor@iaeme.com 2 lb=0 mid=1 ub=2 list[]: 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb mid ub lb=0 mid=0 ub=0 A[] : 0 1 2 3 4 5 6 23 47 53 81 10 34 66 lb,mid,ub 3 lb=2 mid=2 ub=2 list[] : 0 1 2 3 4 5 6 10 23 34 47 53 66 81 lb,mid,ub lb=1 ub=0 A[] : 0 1 2 3 4 5 6 23 47 53 81 10 34 66 ub,mid lb if(ub<lb) then Exit 4 lb=2 ub=1 list[] : 0 1 2 3 4 5 6 10 23 34 47 53 66 81 ub mid,lb if(ub<lb) then Exit Total Function Calls 4 3 Result Element Not Found Element Not Found In classical binary search, to find KEY 27 which is not present in the list, the total number of function calls required are 4. But, using Odd Even Based Binary Search Algorithm, the total number of function calls reduced from 4 to 3. It leads to average case time complexity. 4. PERFORMANCE ANALYSIS OF ODD EVEN BASED BINARY SEARCH The time complexity of binary search algorithm in worst case is O (log2N). By using, Odd Even Based Binary Search algorithm the time complexity reduced to O (log (N-M)) where M is total number of even numbers if KEY is ODD or total number of odd numbers if KEY is EVEN. Therefore, ODD EVEN BASED BINARY SEARCH ALGORITHM provides better results, if a list has combination of even and odd numbers. The performance of Odd Even Based Binary Search and classical Binary Search were tested and
  • 9. Karthick S http://www.iaeme.com/IJCET/index.asp 48 editor@iaeme.com implemented in MATLAB Version 7.10.0.499 (R2010a) for various input lengths 5000, 10000, 15000, 20000, 25000 and 30000. Both the searching algorithms are executed on machine with 64 bit Operating System, Intel® Core i5-3210M CPU @ 2.50GHz, 2.50GHz installed memory (RAM) of 4GB. The running time of an algorithm is measured by using Matlab Profiler. Profiler is used to measure total running time taken by the algorithm, total number of function calls, total number of times particular line(s) of code has been executed [6]. Table 4 CPU time for different lengths of input sequences Key Number of input elements Binary Search (Running Time in µs) Odd Even Based Search (Running Time in µs) 22491 5000 5 0 66600 10000 6 4 133191 15000 16 5 139986 20000 9 5 3501 25000 9 2 16866 30000 9 2 Figure 1 CPU time taken for different input lengths Table 5 Function calls to find the key in different length of input sequences Key Number of input elements Binary Search (No of function calls) Odd Even Based Search (No of function calls) 22491 5000 13 1 66600 10000 14 9 133191 15000 14 11 139986 20000 15 11 3501 25000 14 6 16866 30000 15 4
  • 10. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 49 editor@iaeme.com Figure 2 Number of Function calls for different input lengths 4.1. TEST RESULTS Consider an ordered array consisting of N elements (N = 5000 / 10000 / 15000 / 20000 / 25000 / 30000) and the values stored in the array are uniformly distributed with the difference of 9. Thereafter both the searching algorithms namely, Binary Search and Odd Even Based Binary Search are applied. The performance measured using MATLAB Profiler and results are shown below. Table 6 Test results with profile summary for various input length sequences Type Array Key 22491 Binary Search lb 1 ub 5000 list[]: 1 2 2500 2501 4999 5000 9 18 … 22500 22509 ... 44991 45000 lb ub Figure 3. Profile summary to find key 22491 in Binary Search
  • 11. Karthick S http://www.iaeme.com/IJCET/index.asp 50 editor@iaeme.com Odd Even Based Binary Search lb 1 ub 2500 Key 66600 Binary Search lb 1 ub 10000 a[]: 1 2 2500 2501 4999 5000 9 27 … 44991 18 ... 44982 45000 odd_lb odd_ub even_lb even_ub Figure 4. Profile summary to find key 22491 in Odd Even Based Binary Search list[]: 1 2 5000 5001 9999 10000 9 18 … 45000 45009 ... 89991 90000 lb ub Figure 5. Profile summary to find key 66600 in Binary Search
  • 12. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 51 editor@iaeme.com Odd Even Based Binary Search lb 5001 ub 10000 a[]: 1 2 5000 5001 9999 10000 9 27 … 89991 18 ... 88982 90000 odd_lb odd_ub even_lb even_ub Figure 6. Profile summary to find key 66600 in Odd Even Based Binary Search Key 133191 Binary Search lb 1 ub 15000 list[]: 1 2 7500 7501 14999 15000 9 18 … 67500 67509 ... 134991 135000 lb ub Figure 7. Profile summary to find key 133191 in Binary Search
  • 13. Karthick S http://www.iaeme.com/IJCET/index.asp 52 editor@iaeme.com Odd Even Based Binary Search lb 1 ub 7500 a[]: 1 2 7500 7501 14999 15000 9 27 … 134991 18 ... 134982 135000 odd_lb odd_ub even_lb even_ub Figure 8. Profile summary to find key 133191 in Odd Even Based Binary Search Key 139986 Binary Search lb 1 ub 20000 list[]: 1 2 10000 10001 19999 20000 9 18 … 90000 90009 ... 179991 180000 lb ub Figure 9. Profile summary to find key 139986 in Binary Search
  • 14. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 53 editor@iaeme.com Odd Even Based Binary Search lb 10001 ub 20000 a[]: 1 2 10000 10001 19999 20000 9 27 … 179991 18 ... 179982 180000 odd_lb odd_ub even_lb even_ub Figure 10. Profile summary to find key 139986 in Odd Even Based Binary Search Key 3501 Binary Search lb 1 ub 25000 list[]: 1 2 12500 12501 24999 25000 9 18 … 112500 112509 ... 224991 225000 lb ub Figure 11. Profile summary to find key 3501 in Binary Search
  • 15. Karthick S http://www.iaeme.com/IJCET/index.asp 54 editor@iaeme.com Odd Even Based Binary Search lb 1 ub 12500 a[]: 1 2 12500 12501 24999 25000 9 27 … 224991 18 ... 224982 225000 odd_lb odd_ub even_lb even_ub Figure 12. Profile summary to find key 3501 in Odd Even Based Binary Search Key 16866 Binary Search lb 1 ub 30000 list[]: 1 2 15000 15001 29999 30000 9 18 … 135000 135009 ... 269991 270000 lb ub Figure 13. Profile summary to find key 16866 in Binary Search
  • 16. Odd Even Based Binary Search http://www.iaeme.com/IJCET/index.asp 55 editor@iaeme.com Odd Even Based Binary Search lb 15001 ub 30000 a[]: 1 2 15000 15001 29999 30000 9 27 … 269991 18 ... 269982 270000 odd_lb odd_ub even_lb even_ub Figure 14. Profile summary to find key 16866 in Odd Even Based Binary Search 5. CONCLUSION Reducing the running time of any searching algorithms provide better results and it also helps to retrieve the information quickly once the user submits the query. In this paper, a new algorithm is proposed and it provides better result than the existing algorithm. The performance graphs, test results and function calls clearly show Odd Even Based Binary Search Algorithm is better than classical Binary Search Algorithm. ACKNOWLEDGEMENTS I would like to express sincere gratitude to Prof. Joy Paulose, H.O.D the Department of Computer Science Christ University, the Coordinator Dr. Rohini V. and Prof. Sumitra Binu for their valuable support, encouragement and suggestions during the research work. REFERENCES [1] Chitra Ravi, Data Structures Using C. (Bangalore, Subhas Publishers, 2013). [2] J. P. Tremblay and P. G. Sorenson, An introduction to data structures with applications (New York, McGraw-Hill, 1976). [3] N. Arora, G. Bhasin, and N. Sharma, Two way linear search algorithm, International Journal of Computer Applications, 107(21), 2014, 6-8. [4] Alwin Francis and Rajesh Ramachandran, Modulo Ten Search- An Alternative to Linear Search, Proc. 2nd IEEE Conf. on Process Automation, Control and Computing, Coimbatore, TamilNadu, 2011, 1-4. [5] P. Kumar, Quadratic search: A new and fast searching algorithm (an extension of classical binary search strategy), International Journal of Computer Applications, 65(14), 2013, 43–46. [6] Profile, "Profile to improve performance," 1994. [Online]. Available: http://in.mathworks.com/help/matlab/matlab_prog/profiling-for-improving-performance.html.