0% found this document useful (0 votes)
89 views17 pages

Puta

This document discusses binary search and binary tree traversal algorithms. It begins with explanations of binary search and how it has a time complexity of O(log n) in average and worst cases. It then covers the three types of binary tree traversal: preorder, inorder, and postorder. The document also proposes a new algorithm for securing data using tree traversal mechanisms and analyzes its advantages of high security and disadvantages of memory waste and complex development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views17 pages

Puta

This document discusses binary search and binary tree traversal algorithms. It begins with explanations of binary search and how it has a time complexity of O(log n) in average and worst cases. It then covers the three types of binary tree traversal: preorder, inorder, and postorder. The document also proposes a new algorithm for securing data using tree traversal mechanisms and analyzes its advantages of high security and disadvantages of memory waste and complex development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Divide and Conquer: 3.

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

Binary Tree Traversal


What is Binary Tree Traversal
Binary Tree Traversal is…
▫ A searching algorithm
▫ the process of visiting each node in the tree exactly
once.
1. Preorder traversal (Root, Left, Right)
2. Inorder traversal (Left, Root, Right)
3. Postorder traversal (Left, Right, Root)
▫ Douglas (1959), Windley (1960), and later Hibbard
(1962) introduced binary search trees and gave their
applications to sorting, searching, and file maintenance.
11
In best case,
▫ The binary search tree is a balanced binary search tree.
▫ Height of the binary search tree becomes log(n).
▫ So, Time complexity of BST Operations = O(logn).

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

You might also like