SlideShare a Scribd company logo
1 of 44
Presented By 
Nayeem Hasan 
ID: 2013-1-60-066 
S.M.Sadman Sadid 
ID: 2013-1-60-065 
Tanzim Rizwan 
ID: 2013-1-60-063 
Department of Computer Science & Engineering 
East West University 
Slide: 1
OVERVIEW 
Definition. 
Structure. 
Application. 
Insertion. 
Search. 
Deletion. 
Slide: 2
What is DST? 
Definition 
Digital search tree is one kind of binary tree which 
contains only binary data. 
If the bit of DST starts with 0 then it is in left subtree and if 
the bit starts with 1 then it is in right subtree and this 
process works recursively. 
Slide: 3
Simple Structure(4 bits only) 
**** 
0*** 
00** 
001* 
1*** 
10** 
100* 
11** 
110* 
Slide: 4
Digital Search Tree Example 
A 00001 
S 10011 
E 00101 
R 10010 
C 00011 
H 01000 
A 
S 
R 
E 
C H 
Slide: 5
Search Time Of DST 
Searching is based on binary representation of data. 
If the data are randomly distributed then the average 
search time per operation in O(log N), where N is the 
height of the tree. 
However, Worst case is O(b), where b is the number 
of bits in the search key. 
Slide: 6
Application Of DST 
IP routing. 
IPv4 – 32 bit IP address. 
IPv6 – 128 bit IP address. 
Firewalls. 
Slide: 7
What is IPv4 and IPv6? 
IPv4 is the fourth generation of internet protocol version and the 
most used version. 
IPv4 uses 32 bit address which divided into four 8- bit parts and 
which limits the address space to 4,294,967,296 (232 ) possible 
unique address. 
Slide: 8
IPv6 is the Internet's next-generation protocol and the current version of 
internet protocol which replace the IPv4. 
IPv6 uses 128- bit hexadecimal address which divides in 8 parts and each 
part contains 16 bit binary number and which is designed to identification 
and location system for computers on networks and routes traffic across the 
Internet. 
Slide: 9
What is firewall? 
• A firewall is a network security system, either hardware or software based, 
that controls incoming and outgoing network traffic based on a set of rules. 
• Firewall is a software program or piece of hardware that helps screen out 
hackers, viruses, and worms that try to reach your computer over the 
Internet 
Slide: 10
Insertion, search and deletion in DST are easier than 
the Binary search tree and AVL tree. 
This tree does not required additional information to 
maintain the balance of the tree because the depth of 
the tree is limited by the length of the key element. 
DST requires less memory than Binary search tree and 
AVL tree. 
Benefit Of DST 
Slide: 11
Drawbacks Of DST 
Bitwise operations are not always easy. 
Handling duplicates is problematic. 
Similar problem with keys of different lengths. 
Data is not sorted. 
If a key is long search and comparisons are costly, this 
can be problem 
Slide: 12
Insertion of DST 
 To insert an element in DST. There will be four(4) possible 
cases. 
 Tree Empty 
 If found ‘0’, then go left 
 If found ‘1’ then go right 
 If found same key, then insert with prefix equal 
Slide: 13
Insertion of DST (Cont.) 
Start with an empty 
digital search tree and 
insert a pair whose key 
is 1001 
A 
1001 
Slide: 14
Insertion of DST (Cont.) 
Start with an empty 
digital search tree and 
insert a pair whose key 
is 1001 
A 
1001 
Now, insert a pair 
whose key is 0110 
A 
1001 
B 
0110 
Slide: 15
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 1111 
A 
1001 
B 
0110 
C 
1111 
Slide: 16
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 0000 
A 
1001 
B 
0110 
C 
1111 
D 
0000 
Slide: 17
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 0100 
A 
1001 
B 
0110 
C 
1111 
D E 
0000 0100 
Slide: 18
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 0101 
A 
1001 
B 
0110 
C 
1111 
D E 
0000 0100 
0101 
G 
Slide: 19
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 1110 
A 
1001 
B 
0110 
C 
1111 
D E 
0000 0100 
0101 
G 
I 
1110 
Slide: 20
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 11 
A 
1001 
B 
0110 
C 
1111 
D E 
0000 0100 
0101 
G 
11 
F 
1110 
I 
Slide: 21
Insertion of DST (Cont.) 
Now, insert a pair 
whose key is 11 
A 
1001 
B 
0110 
C 
1111 
D E 
0000 0100 
0101 
G 
11 
F 
I 
1110 
Slide: 22
Insertion Pseudo Code of DST 
insert() 
To insert an item, with a key, k, we begin a search from the root node to 
locate the insertion position for the item. 
 if t->root is null then 
{ 
t->root = new node for the item with key k; 
return null; 
} 
p = t->root; 
i = max_b; 
Slide: 23
loop 
{ 
if p->key == k then a matching item has been found 
return p->item; 
i = i - 1; /*Traverse left or right branch, depending on the current bit.*/ 
let j be the value of the (i)th bit of k; 
if p->a[j] is null then 
{ 
p->a[j] = new node for the item with key k; 
return null; 
} 
p = p->a[j]; 
} 
Insertion Pseudo Code of DST 
Slide: 24
Insertion Pseudo Code of DST 
In the above pseudo-code, insertion fails if there is already an item with key 
k in the tree, and a pointer to the matching item will be returned. 
Otherwise, when insertion is successful, a null pointer is returned. When the 
new node, x, is created, its fields are initialized as follows. 
x->key = k; 
x->item = item; 
x->a[0] = x->a[1] = NULL; 
Slide: 25
DST search for key K 
Search 
For each node T in the tree we have 4 possible results 
T is empty 
K matches T 
Current bit of K is a 0 and go to left child 
Current bit of K is a 1 and go to right child 
Slide: 26
Example 
Search 0001 
NOT FOUND 
A 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
B 
C 
D 
E 
F 
G 
I 
Slide: 27
Search 0000 
Now 0000=D 
So K found 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
Example 
A 
B 
C 
D 
E 
F 
G 
I 
Slide: 28
Search 1110 
Now 1110=I 
So K found 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
Example 
A 
B 
C 
D 
E 
F 
G 
I 
Slide: 29
Search 0100 
Now 0100=E 
So K found 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
Example 
A 
B 
C 
D 
E 
F 
G 
I 
Slide: 30
Struct node{ 
int key,info; 
struct node *l,*r ; 
} 
static struct node *head,*z; 
unsigned bits(unsigned x, int k, int j) 
return (x>>k) & ~(~0<<j); 
Int digital_search(int v) 
{ 
struct node *x=head; 
int b=maxb; // maxb is the number of bits in the key to be sorted 
z->key=v; 
while(v!=x->key) 
x=(bits(v,b--,1) ? x->r : x->l; 
return x->info; 
} 
C code of DST Search 
Slide: 31
For each node T in the tree we have 3 possible cases. 
 No child 
 One child 
 Two children 
Delete 
Slide: 32
Example 
Delete G(0101) 
A 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
B 
C 
D 
E 
F 
G 
I 
Slide: 33
Example 
Delete G(0101) 
G has no child, 
So simply remove G 
And replace 
by a NIL pointer 
A 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
B 
C 
D 
E 
F 
G 
I 
Slide: 34
Example 
Delete F(11) 
F has one child, 
So, first remove F 
A 
1001 
1111 
11 
0110 
0000 0100 
0101 1110 
B 
C 
D 
E 
F 
G 
I 
Slide: 35
Example 
Delete F(11) 
And link C with I 
1001 
0110 1111 
0000 0100 
0101 
1110 
A 
B 
C 
D 
E 
G 
I 
Slide: 36
Example 
Delete B(0110) 
B has two children 
D(0000) and E(0100) 
1001 
0110 1111 
0000 0100 
0101 
11 
A 
B 
C 
D 
E 
G 
F 
I 
1110 
Slide: 37
Example 
Delete B(0110) 
Remove B and replace 
with one of its child 
1001 
0110 1111 
0000 0100 
0101 
11 
A 
B 
C 
D 
E 
G 
F 
I 
1110 
Slide: 38
Example 
Delete B(0110) 
Replace B with D 
1001 
0000 1111 
0100 
0101 
11 
A 
C 
D 
E 
G 
F 
I 
1110 
Slide: 39
1001 
1111 
11 
0000 
0100 
0101 
1110 
A 
C 
D 
E 
G F 
I 
Example 
Delete B(0110) 
OR 
Replace B with E 
Slide: 40
Delete Pseudo code of DST 
1.Search key 
2. if(key==Node) 
free(Node); 
if(Node->left==NULL && Node->right==NULL 
Do Nothing; 
else if(Node->left!=NULL) 
Replace Node with next left Node 
else if(Node->right!=NULL) 
Replace Node with next right Node 
else if(Node->right!=NULL && Node->left!=NULL ) 
Replace Node with next any Node 
Slide: 41
Conclusion 
The digital search trees can be recommended for use whenever 
the keys stored are integers 
Character strings of fixed width. 
DSTs are also suitable in many cases when the keys are strings 
of variable length. 
Slide: 42
THANK YOU ALL !!! 
Slide: 43

More Related Content

What's hot

Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysissumitbardhan
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionHAMID-50
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary treeKrish_ver2
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AIKirti Verma
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptSeethaDinesh
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search StrategiesAmey Kerkar
 

What's hot (20)

Heaps
HeapsHeaps
Heaps
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Multi ways trees
Multi ways treesMulti ways trees
Multi ways trees
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Leftist heap
Leftist heapLeftist heap
Leftist heap
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletion
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
Chapter 12 ds
Chapter 12 dsChapter 12 ds
Chapter 12 ds
 
Linked list
Linked listLinked list
Linked list
 
b+ tree
b+ treeb+ tree
b+ tree
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 
Digital search tree
Digital search treeDigital search tree
Digital search tree
 
Red black tree
Red black treeRed black tree
Red black tree
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
Binomial queues
Binomial queuesBinomial queues
Binomial queues
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 

Viewers also liked

Application of tries
Application of triesApplication of tries
Application of triesTech_MX
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing OperationsRico
 
Tries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsTries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsAmrinder Arora
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data StructuresSHAKOOR AB
 
Advance data structure
Advance data structureAdvance data structure
Advance data structureashok kumar
 
Lecture storage-buffer
Lecture storage-bufferLecture storage-buffer
Lecture storage-bufferKlaas Krona
 
Avl trees
Avl treesAvl trees
Avl treesppreeta
 
Introduction of suffix tree
Introduction of suffix treeIntroduction of suffix tree
Introduction of suffix treeLiou Shu Hung
 
Packet forwarding in wan.46
Packet  forwarding in wan.46Packet  forwarding in wan.46
Packet forwarding in wan.46myrajendra
 
06 file processing
06 file processing06 file processing
06 file processingIssay Meii
 
Binary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackBinary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackAmrinder Arora
 
Suffix Tree and Suffix Array
Suffix Tree and Suffix ArraySuffix Tree and Suffix Array
Suffix Tree and Suffix ArrayHarshit Agarwal
 
Data structure tries
Data structure triesData structure tries
Data structure triesMd. Naim khan
 
File Structure Concepts
File Structure ConceptsFile Structure Concepts
File Structure ConceptsDileep Kodira
 

Viewers also liked (20)

Application of tries
Application of triesApplication of tries
Application of tries
 
Trie Data Structure
Trie Data StructureTrie Data Structure
Trie Data Structure
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing Operations
 
Tries - Tree Based Structures for Strings
Tries - Tree Based Structures for StringsTries - Tree Based Structures for Strings
Tries - Tree Based Structures for Strings
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data Structures
 
Advance data structure
Advance data structureAdvance data structure
Advance data structure
 
Lecture storage-buffer
Lecture storage-bufferLecture storage-buffer
Lecture storage-buffer
 
Avl trees
Avl treesAvl trees
Avl trees
 
B tree short
B tree shortB tree short
B tree short
 
Introduction to statistics ii
Introduction to statistics iiIntroduction to statistics ii
Introduction to statistics ii
 
Introduction of suffix tree
Introduction of suffix treeIntroduction of suffix tree
Introduction of suffix tree
 
Packet forwarding in wan.46
Packet  forwarding in wan.46Packet  forwarding in wan.46
Packet forwarding in wan.46
 
06 file processing
06 file processing06 file processing
06 file processing
 
Binary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red BlackBinary Search Trees - AVL and Red Black
Binary Search Trees - AVL and Red Black
 
Avl trees
Avl treesAvl trees
Avl trees
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Trie tree
Trie treeTrie tree
Trie tree
 
Suffix Tree and Suffix Array
Suffix Tree and Suffix ArraySuffix Tree and Suffix Array
Suffix Tree and Suffix Array
 
Data structure tries
Data structure triesData structure tries
Data structure tries
 
File Structure Concepts
File Structure ConceptsFile Structure Concepts
File Structure Concepts
 

Similar to Digital Search Tree

Digital Search Tree
Digital Search TreeDigital Search Tree
Digital Search TreeSM. Aurnob
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Chapter_02_The_Language_of_Bits_Any.pptx
Chapter_02_The_Language_of_Bits_Any.pptxChapter_02_The_Language_of_Bits_Any.pptx
Chapter_02_The_Language_of_Bits_Any.pptxduttnikhil2403
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Studentsshaival
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009lionking
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptxChandraV13
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptssuser52a19e
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalUtkirjonUbaydullaev1
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRAJKUMARP63
 
01.number systems
01.number systems01.number systems
01.number systemsrasha3
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptskatiarrahaman
 
unit-i-number-systems.pdf
unit-i-number-systems.pdfunit-i-number-systems.pdf
unit-i-number-systems.pdfRameshK531901
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRabiaAsif31
 

Similar to Digital Search Tree (20)

Digital Search Tree
Digital Search TreeDigital Search Tree
Digital Search Tree
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter_02_The_Language_of_Bits_Any.pptx
Chapter_02_The_Language_of_Bits_Any.pptxChapter_02_The_Language_of_Bits_Any.pptx
Chapter_02_The_Language_of_Bits_Any.pptx
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Students
 
UNIT-1_CSA.pdf
UNIT-1_CSA.pdfUNIT-1_CSA.pdf
UNIT-1_CSA.pdf
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptx
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
binary-numbers.ppt
binary-numbers.pptbinary-numbers.ppt
binary-numbers.ppt
 
numbers system
numbers systemnumbers system
numbers system
 
01.number systems
01.number systems01.number systems
01.number systems
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
 
b-tree.ppt
b-tree.pptb-tree.ppt
b-tree.ppt
 
unit-i-number-systems.pdf
unit-i-number-systems.pdfunit-i-number-systems.pdf
unit-i-number-systems.pdf
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
number system
number systemnumber system
number system
 

More from East West University

An approach to enhancing image contrast using genetic algorithm
An approach to enhancing image contrast using  genetic algorithmAn approach to enhancing image contrast using  genetic algorithm
An approach to enhancing image contrast using genetic algorithmEast West University
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsEast West University
 
Simulation of food serving system of EWU canteen using Arena software
Simulation of food serving system of EWU canteen using Arena softwareSimulation of food serving system of EWU canteen using Arena software
Simulation of food serving system of EWU canteen using Arena softwareEast West University
 

More from East West University (6)

An approach to enhancing image contrast using genetic algorithm
An approach to enhancing image contrast using  genetic algorithmAn approach to enhancing image contrast using  genetic algorithm
An approach to enhancing image contrast using genetic algorithm
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State Protocols
 
Simulation of food serving system of EWU canteen using Arena software
Simulation of food serving system of EWU canteen using Arena softwareSimulation of food serving system of EWU canteen using Arena software
Simulation of food serving system of EWU canteen using Arena software
 
Right to be Forgotten
Right to be ForgottenRight to be Forgotten
Right to be Forgotten
 
Wannacry Virus
Wannacry VirusWannacry Virus
Wannacry Virus
 
Software piracy in Bangladesh
Software piracy in BangladeshSoftware piracy in Bangladesh
Software piracy in Bangladesh
 

Recently uploaded

毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxFurkanTasci3
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 

Recently uploaded (20)

毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptx
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 

Digital Search Tree

  • 1.
  • 2. Presented By Nayeem Hasan ID: 2013-1-60-066 S.M.Sadman Sadid ID: 2013-1-60-065 Tanzim Rizwan ID: 2013-1-60-063 Department of Computer Science & Engineering East West University Slide: 1
  • 3. OVERVIEW Definition. Structure. Application. Insertion. Search. Deletion. Slide: 2
  • 4. What is DST? Definition Digital search tree is one kind of binary tree which contains only binary data. If the bit of DST starts with 0 then it is in left subtree and if the bit starts with 1 then it is in right subtree and this process works recursively. Slide: 3
  • 5. Simple Structure(4 bits only) **** 0*** 00** 001* 1*** 10** 100* 11** 110* Slide: 4
  • 6. Digital Search Tree Example A 00001 S 10011 E 00101 R 10010 C 00011 H 01000 A S R E C H Slide: 5
  • 7. Search Time Of DST Searching is based on binary representation of data. If the data are randomly distributed then the average search time per operation in O(log N), where N is the height of the tree. However, Worst case is O(b), where b is the number of bits in the search key. Slide: 6
  • 8. Application Of DST IP routing. IPv4 – 32 bit IP address. IPv6 – 128 bit IP address. Firewalls. Slide: 7
  • 9. What is IPv4 and IPv6? IPv4 is the fourth generation of internet protocol version and the most used version. IPv4 uses 32 bit address which divided into four 8- bit parts and which limits the address space to 4,294,967,296 (232 ) possible unique address. Slide: 8
  • 10. IPv6 is the Internet's next-generation protocol and the current version of internet protocol which replace the IPv4. IPv6 uses 128- bit hexadecimal address which divides in 8 parts and each part contains 16 bit binary number and which is designed to identification and location system for computers on networks and routes traffic across the Internet. Slide: 9
  • 11. What is firewall? • A firewall is a network security system, either hardware or software based, that controls incoming and outgoing network traffic based on a set of rules. • Firewall is a software program or piece of hardware that helps screen out hackers, viruses, and worms that try to reach your computer over the Internet Slide: 10
  • 12. Insertion, search and deletion in DST are easier than the Binary search tree and AVL tree. This tree does not required additional information to maintain the balance of the tree because the depth of the tree is limited by the length of the key element. DST requires less memory than Binary search tree and AVL tree. Benefit Of DST Slide: 11
  • 13. Drawbacks Of DST Bitwise operations are not always easy. Handling duplicates is problematic. Similar problem with keys of different lengths. Data is not sorted. If a key is long search and comparisons are costly, this can be problem Slide: 12
  • 14. Insertion of DST  To insert an element in DST. There will be four(4) possible cases.  Tree Empty  If found ‘0’, then go left  If found ‘1’ then go right  If found same key, then insert with prefix equal Slide: 13
  • 15. Insertion of DST (Cont.) Start with an empty digital search tree and insert a pair whose key is 1001 A 1001 Slide: 14
  • 16. Insertion of DST (Cont.) Start with an empty digital search tree and insert a pair whose key is 1001 A 1001 Now, insert a pair whose key is 0110 A 1001 B 0110 Slide: 15
  • 17. Insertion of DST (Cont.) Now, insert a pair whose key is 1111 A 1001 B 0110 C 1111 Slide: 16
  • 18. Insertion of DST (Cont.) Now, insert a pair whose key is 0000 A 1001 B 0110 C 1111 D 0000 Slide: 17
  • 19. Insertion of DST (Cont.) Now, insert a pair whose key is 0100 A 1001 B 0110 C 1111 D E 0000 0100 Slide: 18
  • 20. Insertion of DST (Cont.) Now, insert a pair whose key is 0101 A 1001 B 0110 C 1111 D E 0000 0100 0101 G Slide: 19
  • 21. Insertion of DST (Cont.) Now, insert a pair whose key is 1110 A 1001 B 0110 C 1111 D E 0000 0100 0101 G I 1110 Slide: 20
  • 22. Insertion of DST (Cont.) Now, insert a pair whose key is 11 A 1001 B 0110 C 1111 D E 0000 0100 0101 G 11 F 1110 I Slide: 21
  • 23. Insertion of DST (Cont.) Now, insert a pair whose key is 11 A 1001 B 0110 C 1111 D E 0000 0100 0101 G 11 F I 1110 Slide: 22
  • 24. Insertion Pseudo Code of DST insert() To insert an item, with a key, k, we begin a search from the root node to locate the insertion position for the item.  if t->root is null then { t->root = new node for the item with key k; return null; } p = t->root; i = max_b; Slide: 23
  • 25. loop { if p->key == k then a matching item has been found return p->item; i = i - 1; /*Traverse left or right branch, depending on the current bit.*/ let j be the value of the (i)th bit of k; if p->a[j] is null then { p->a[j] = new node for the item with key k; return null; } p = p->a[j]; } Insertion Pseudo Code of DST Slide: 24
  • 26. Insertion Pseudo Code of DST In the above pseudo-code, insertion fails if there is already an item with key k in the tree, and a pointer to the matching item will be returned. Otherwise, when insertion is successful, a null pointer is returned. When the new node, x, is created, its fields are initialized as follows. x->key = k; x->item = item; x->a[0] = x->a[1] = NULL; Slide: 25
  • 27. DST search for key K Search For each node T in the tree we have 4 possible results T is empty K matches T Current bit of K is a 0 and go to left child Current bit of K is a 1 and go to right child Slide: 26
  • 28. Example Search 0001 NOT FOUND A 1001 1111 11 0110 0000 0100 0101 1110 B C D E F G I Slide: 27
  • 29. Search 0000 Now 0000=D So K found 1001 1111 11 0110 0000 0100 0101 1110 Example A B C D E F G I Slide: 28
  • 30. Search 1110 Now 1110=I So K found 1001 1111 11 0110 0000 0100 0101 1110 Example A B C D E F G I Slide: 29
  • 31. Search 0100 Now 0100=E So K found 1001 1111 11 0110 0000 0100 0101 1110 Example A B C D E F G I Slide: 30
  • 32. Struct node{ int key,info; struct node *l,*r ; } static struct node *head,*z; unsigned bits(unsigned x, int k, int j) return (x>>k) & ~(~0<<j); Int digital_search(int v) { struct node *x=head; int b=maxb; // maxb is the number of bits in the key to be sorted z->key=v; while(v!=x->key) x=(bits(v,b--,1) ? x->r : x->l; return x->info; } C code of DST Search Slide: 31
  • 33. For each node T in the tree we have 3 possible cases.  No child  One child  Two children Delete Slide: 32
  • 34. Example Delete G(0101) A 1001 1111 11 0110 0000 0100 0101 1110 B C D E F G I Slide: 33
  • 35. Example Delete G(0101) G has no child, So simply remove G And replace by a NIL pointer A 1001 1111 11 0110 0000 0100 0101 1110 B C D E F G I Slide: 34
  • 36. Example Delete F(11) F has one child, So, first remove F A 1001 1111 11 0110 0000 0100 0101 1110 B C D E F G I Slide: 35
  • 37. Example Delete F(11) And link C with I 1001 0110 1111 0000 0100 0101 1110 A B C D E G I Slide: 36
  • 38. Example Delete B(0110) B has two children D(0000) and E(0100) 1001 0110 1111 0000 0100 0101 11 A B C D E G F I 1110 Slide: 37
  • 39. Example Delete B(0110) Remove B and replace with one of its child 1001 0110 1111 0000 0100 0101 11 A B C D E G F I 1110 Slide: 38
  • 40. Example Delete B(0110) Replace B with D 1001 0000 1111 0100 0101 11 A C D E G F I 1110 Slide: 39
  • 41. 1001 1111 11 0000 0100 0101 1110 A C D E G F I Example Delete B(0110) OR Replace B with E Slide: 40
  • 42. Delete Pseudo code of DST 1.Search key 2. if(key==Node) free(Node); if(Node->left==NULL && Node->right==NULL Do Nothing; else if(Node->left!=NULL) Replace Node with next left Node else if(Node->right!=NULL) Replace Node with next right Node else if(Node->right!=NULL && Node->left!=NULL ) Replace Node with next any Node Slide: 41
  • 43. Conclusion The digital search trees can be recommended for use whenever the keys stored are integers Character strings of fixed width. DSTs are also suitable in many cases when the keys are strings of variable length. Slide: 42
  • 44. THANK YOU ALL !!! Slide: 43