Puta
Puta
Binary Search
What is Binary Search
Binary Search is…
▫ A searching algorithm
▫ also known as a half-interval search, is an algorithm
used in computer science to locate a specified value
(key) within an array.
▫ In 1946, John Mauchly made the first mention of
binary search as part of the Moore School Lectures
3
Simulation
If data found, then then we stop the further iteration. In this case, time complexity will
be O(1), best case. Otherwise, we will move to next step.
Next step is divide the iteration in half until we find the value. So…
n/(2^k)=1 we can rewrite it as – 2^k=n by taking log both side, we get k=log2n So, in
average and worst case, time complexity of binary search algorithm is log(n).
4
Sample Program
5
Research: Novel Binary Search Algorithm of
Backtracking for RFID Tag Anti-Collision
Abstract—In RFID system, tag collision is a main problem for fast tag
identification. On the base of binary search algorithm of backtracking, an
enhanced binary anti-collision search algorithm for radio frequency identification
(RFID) system is presented in this paper. By dynamically transferring the ID of the
tag, the length of the data transferred can be decreased dramatically.
Mathematical simulation result shows that compared with the binary search
algorithm of backtracking, the proposed algorithm can save channel by more
than 43.75% when handling multiple RFID tags simultaneously. Finally the
proposed algorithm is successfully applied to a RFID device, which validates itself.
6
Proposed Algorithm and its Results
7
Conclusion
The new algorithm is able to save channel by more than
43.75% when handling multiple RFID tags simultaneously. Moreover, the
longer the bits of the encoding of tags, the better the performance are.
Performance evaluation by simulation and the application in a RFID
device show that the proposed algorithm has the superiority comparing
to the binary search algorithm of backtracking.
8
Divide and Conquer: 3.5
In worst case,
▫ The binary search tree is a skewed binary search tree.
▫ Height of the binary search tree becomes n.
▫ So, Time complexity of BST Operations = O(n).
12
Simulation
PreOrder - 8, 5, 9, 7, 1, 12, 2, 4, 11, 3
InOrder - 9, 5, 1, 7, 2, 12, 8, 4, 3, 11
PostOrder - 9, 1, 2, 12, 7, 5, 3, 11, 4, 8
13
Sample Program
14
Research: Data Security Using Tree Traversal
Abstract- We all know that presently in 21st century one of the most
emerging problem is Data Security. There is no guarantee that the data we have
sent may be hacked by any Hacker or the data we have sent may reach correctly
to the receiver or not. So many data security techniques have been emerged
from past 2 to 3 years. But still we need a best technique to protect the data
from third parties.
15
Proposed Algorithm and its Results
a) Advantages
▫ This mechanism
provides more
security for the data
from hackers means
the performance of
secure level is more
b) Dis-Advantages
a) Memory wastage
because of sending
the data in two
different traversals
b) Developing of
algorithm for this
mechanism is
somewhat complex.
16
Conclusion
According to the results this one of the best encryption and
decryption techniques using tree traversal mechanism which provides
high end security to the data and the development of the mechanism
and is explained in this paper completely.
17