SlideShare une entreprise Scribd logo
1  sur  25
Tree
Adam M.B.
DEFINITION

Tree
Tree is data structure that is non linear and can
be used to represents data in hierarchy
between those elements. For example:
organization structure, family tree, and the
tournament.
Components of Tree
A
B C D
E F G
Root (akar)
Leaf (daun)
Level/Tingkat
1
2
3
Subtree
Node/Vertex/Simpul
Edge/Link
TERMINOLOGY

Terminology of Tree
• Predecessor node that is above certain node.
• Successor node that is below certain node
• Ancestor all nodes that is before certain node and in the
same path.
• Descendant all nodes that is after certain node and in
the same path.
Terminology of Tree
• Parent predecessor that is one level above
certain node.
• Sibling nodes that have same parent
• Degree number of child in one node.
Ilustration
Predecessor(B) : A
Successor(A) : B,C,D
Ancestor(E) : B,A
Descendant(B) : E,F
A
B
C
D
E F G
Parent(E) : B
Sibling(E) : F
Degree(A) : 3
Binary Tree
Binary
Tree
The
maximum
degree of one
node is 2.
Maximum
node until
level N is
2N - 1
The
maximum
number of
node each
level is 2 (N-1)
Binary Tree
A
B
G
C
D E F
Left Child Right Child
Root
Maximum node on 3rd
level = 2(N-1)
Maximum node until 3rd
level = 2N - 1
Parent
= 2(3-1)
= 22
= 4
= 23- 1
= 8 - 1
= 7
Types of Binary Tree
Full Binary Tree Complete Binary Tree
A
B
G
C
D E F
A
B C
D E
• All nodes (except leaf)
have two children.
• Each subtree has same
length of path.
• All nodes (except leaf)
have two children.
• Each subtree can has
different length of path.
m
MAKING OF
BINARY TREE

Making of Binary Tree
• From input data
• From general tree
• From result of traversal process
From Input Data
• If value of inserted node is bigger than
parent then it will be right subtree.
• If value of inserted node is smaller than
parent then it will be left subtree.
• This tree is known as binary search tree.
From Input Data
Example:
H will be root
A < H :
A will be left child of H
K > H :
K will be right child of H
C < H  C > A :
C will be right child of A
B < H  B > A  B < C :
B will be left child of C
L > H  L > K :
L will be right child of K
J < H  J < K :
J will be left child of K
H
A
L
K
B
C J
AH KCBLJ
Make binary tree from these input data:
• GHCKJALBEFD
• KGMDLSBRJP
Exercise
From General Tree
• First son in general tree will be left son in
binary tree
• Next brother of first son in general tree
will be right son in binary tree.
From General Tree
General Tree Binary Tree
A
B
H
C
D E F G
I
A
B
H
CD
E F
GI
From General Tree (Program)
One node in general tree One node in binary tree
First Son
(FS)
Next Brother
(NB)
Data Field
(Info)
Left Son
(LS)
Right Son
(RS)
Data Field
(Info)
From General Tree (Program)
General Tree
A
B
H
C
D E F G
I
General Tree
(Linked List)
A
B
Head
CD
F
G
H
I
E
From General Tree (Program)
Binary Tree
(Linked List)
A
B
D
E F
C
I G
H
Head
Binary Tree
A
B
H
CD
E F
GI
From General Tree (Program)
General Tree
(Linked List)
A
B
Head
CD
F
G
H
I
E
Binary Tree
(Linked List)
Head
A
B
D
E F
C
I G
H
Make binary tree from this general tree:
Exercise
K
L
Y
W
M O X
ZR
N
P Q
Make binary tree from this statement:
• K, C, P, E, M, B, R, G, Q, F, W
• E = A + BDH – F
G - K
Exercise
Contact Person:
Adam Mukharil Bachtiar
Informatics Engineering UNIKOM
Jalan Dipati Ukur Nomor. 112-114 Bandung 40132
Email: adfbipotter@gmail.com
Blog: http://adfbipotter.wordpress.com
Copyright © Adam Mukharil Bachtiar 2012

Contenu connexe

Tendances

Trees (data structure)
Trees (data structure)Trees (data structure)
Trees (data structure)Trupti Agrawal
 
trees in data structure
trees in data structure trees in data structure
trees in data structure shameen khan
 
Trees data structure
Trees data structureTrees data structure
Trees data structureSumit Gupta
 
Binary search tree in data structures
Binary search tree in  data structuresBinary search tree in  data structures
Binary search tree in data structureschauhankapil
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operationsKamran Zafar
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeManishPrajapati78
 
Binary Tree in Data Structure
Binary Tree in Data StructureBinary Tree in Data Structure
Binary Tree in Data StructureMeghaj Mallick
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Treekhabbab_h
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data StructureDharita Chokshi
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREESKathirvel Ayyaswamy
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked listFahd Allebdi
 

Tendances (20)

Trees (data structure)
Trees (data structure)Trees (data structure)
Trees (data structure)
 
Binary trees1
Binary trees1Binary trees1
Binary trees1
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
 
Trees data structure
Trees data structureTrees data structure
Trees data structure
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
 
Binary search tree in data structures
Binary search tree in  data structuresBinary search tree in  data structures
Binary search tree in data structures
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Binary tree
Binary tree Binary tree
Binary tree
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
 
Binary Tree in Data Structure
Binary Tree in Data StructureBinary Tree in Data Structure
Binary Tree in Data Structure
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Linked List
Linked ListLinked List
Linked List
 
Linked list
Linked listLinked list
Linked list
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREES
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Red black tree
Red black treeRed black tree
Red black tree
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 

En vedette

Tree identification
Tree identificationTree identification
Tree identificationAnnKoenig
 
Tree and binary tree
Tree and binary treeTree and binary tree
Tree and binary treeZaid Shabbir
 
What Tree Is It?
What Tree Is It?What Tree Is It?
What Tree Is It?SusanVK
 
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
 
Mid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - AfghanistanMid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - AfghanistanAngelene Green
 
Ground SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - AfghanistanGround SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - AfghanistanAngelene Green
 
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016Annapujolo
 
La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016Annapujolo
 
Tree identification
Tree identificationTree identification
Tree identificationPSURNR3xt
 
certificate in health and safety level 2
certificate in health and safety level 2certificate in health and safety level 2
certificate in health and safety level 2Luca De Rosa
 
Certificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ PublonsCertificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ PublonsMohamad Amin Kaviani
 
Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS) Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS) Uma Chidiebere
 

En vedette (20)

Tree identification
Tree identificationTree identification
Tree identification
 
Tree and binary tree
Tree and binary treeTree and binary tree
Tree and binary tree
 
What Tree Is It?
What Tree Is It?What Tree Is It?
What Tree Is It?
 
Leaf ID
Leaf IDLeaf ID
Leaf ID
 
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
 
B+tree
B+treeB+tree
B+tree
 
B+ trees
B+ treesB+ trees
B+ trees
 
Nikhat b+ trees ppt
Nikhat b+ trees pptNikhat b+ trees ppt
Nikhat b+ trees ppt
 
Jjj sem título 1
Jjj sem título 1Jjj sem título 1
Jjj sem título 1
 
Mid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - AfghanistanMid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - Afghanistan
 
Ground SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - AfghanistanGround SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - Afghanistan
 
Flowering trees
Flowering treesFlowering trees
Flowering trees
 
Introdução ao Teste de Software
Introdução ao Teste de SoftwareIntrodução ao Teste de Software
Introdução ao Teste de Software
 
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016
 
La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016
 
Tree identification
Tree identificationTree identification
Tree identification
 
certificate in health and safety level 2
certificate in health and safety level 2certificate in health and safety level 2
certificate in health and safety level 2
 
Certificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ PublonsCertificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ Publons
 
Data Structure (Tree Continued)
Data Structure (Tree Continued)Data Structure (Tree Continued)
Data Structure (Tree Continued)
 
Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS) Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS)
 

Similaire à Data Structure (Tree) (20)

Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
 
Unit – vi tree
Unit – vi   treeUnit – vi   tree
Unit – vi tree
 
Tree 11.ppt
Tree 11.pptTree 11.ppt
Tree 11.ppt
 
07 trees
07 trees07 trees
07 trees
 
Tree of Data Structure
Tree of Data StructureTree of Data Structure
Tree of Data Structure
 
binary tree.pptx
binary tree.pptxbinary tree.pptx
binary tree.pptx
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
Data structure tree - intermediate
Data structure tree - intermediateData structure tree - intermediate
Data structure tree - intermediate
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
 
DS MCQS.pptx
DS MCQS.pptxDS MCQS.pptx
DS MCQS.pptx
 
Binary Trees.ppt
Binary Trees.pptBinary Trees.ppt
Binary Trees.ppt
 
Data structure
Data structureData structure
Data structure
 
Lecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxLecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptx
 
Graph and tree
Graph and treeGraph and tree
Graph and tree
 
Data structure tree- advance
Data structure tree- advanceData structure tree- advance
Data structure tree- advance
 
Implementation of trees
Implementation of trees Implementation of trees
Implementation of trees
 
Data structure tree - beginner
Data structure tree - beginnerData structure tree - beginner
Data structure tree - beginner
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Binary Search Tree Traversal.ppt
Binary Search Tree Traversal.pptBinary Search Tree Traversal.ppt
Binary Search Tree Traversal.ppt
 

Plus de Adam Mukharil Bachtiar

Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfAdam Mukharil Bachtiar
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesAdam Mukharil Bachtiar
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAdam Mukharil Bachtiar
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAdam Mukharil Bachtiar
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAdam Mukharil Bachtiar
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAdam Mukharil Bachtiar
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAdam Mukharil Bachtiar
 

Plus de Adam Mukharil Bachtiar (20)

Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdf
 
Clean Code - Formatting Code
Clean Code - Formatting CodeClean Code - Formatting Code
Clean Code - Formatting Code
 
Clean Code - Clean Comments
Clean Code - Clean CommentsClean Code - Clean Comments
Clean Code - Clean Comments
 
Clean Method
Clean MethodClean Method
Clean Method
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful Names
 
Model Driven Software Development
Model Driven Software DevelopmentModel Driven Software Development
Model Driven Software Development
 
Scrum: How to Implement
Scrum: How to ImplementScrum: How to Implement
Scrum: How to Implement
 
Pengujian Perangkat Lunak
Pengujian Perangkat LunakPengujian Perangkat Lunak
Pengujian Perangkat Lunak
 
Data Mining Clustering
Data Mining ClusteringData Mining Clustering
Data Mining Clustering
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic Programming
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and Conquer
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma Greedy
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute Force
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi Asimptotik
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi Asimptotik
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
 
UML dan Use Case View
UML dan Use Case ViewUML dan Use Case View
UML dan Use Case View
 

Dernier

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Dernier (20)

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Data Structure (Tree)

  • 3. Tree Tree is data structure that is non linear and can be used to represents data in hierarchy between those elements. For example: organization structure, family tree, and the tournament.
  • 4. Components of Tree A B C D E F G Root (akar) Leaf (daun) Level/Tingkat 1 2 3 Subtree Node/Vertex/Simpul Edge/Link
  • 6. Terminology of Tree • Predecessor node that is above certain node. • Successor node that is below certain node • Ancestor all nodes that is before certain node and in the same path. • Descendant all nodes that is after certain node and in the same path.
  • 7. Terminology of Tree • Parent predecessor that is one level above certain node. • Sibling nodes that have same parent • Degree number of child in one node.
  • 8. Ilustration Predecessor(B) : A Successor(A) : B,C,D Ancestor(E) : B,A Descendant(B) : E,F A B C D E F G Parent(E) : B Sibling(E) : F Degree(A) : 3
  • 9. Binary Tree Binary Tree The maximum degree of one node is 2. Maximum node until level N is 2N - 1 The maximum number of node each level is 2 (N-1)
  • 10. Binary Tree A B G C D E F Left Child Right Child Root Maximum node on 3rd level = 2(N-1) Maximum node until 3rd level = 2N - 1 Parent = 2(3-1) = 22 = 4 = 23- 1 = 8 - 1 = 7
  • 11. Types of Binary Tree Full Binary Tree Complete Binary Tree A B G C D E F A B C D E • All nodes (except leaf) have two children. • Each subtree has same length of path. • All nodes (except leaf) have two children. • Each subtree can has different length of path.
  • 13. Making of Binary Tree • From input data • From general tree • From result of traversal process
  • 14. From Input Data • If value of inserted node is bigger than parent then it will be right subtree. • If value of inserted node is smaller than parent then it will be left subtree. • This tree is known as binary search tree.
  • 15. From Input Data Example: H will be root A < H : A will be left child of H K > H : K will be right child of H C < H  C > A : C will be right child of A B < H  B > A  B < C : B will be left child of C L > H  L > K : L will be right child of K J < H  J < K : J will be left child of K H A L K B C J AH KCBLJ
  • 16. Make binary tree from these input data: • GHCKJALBEFD • KGMDLSBRJP Exercise
  • 17. From General Tree • First son in general tree will be left son in binary tree • Next brother of first son in general tree will be right son in binary tree.
  • 18. From General Tree General Tree Binary Tree A B H C D E F G I A B H CD E F GI
  • 19. From General Tree (Program) One node in general tree One node in binary tree First Son (FS) Next Brother (NB) Data Field (Info) Left Son (LS) Right Son (RS) Data Field (Info)
  • 20. From General Tree (Program) General Tree A B H C D E F G I General Tree (Linked List) A B Head CD F G H I E
  • 21. From General Tree (Program) Binary Tree (Linked List) A B D E F C I G H Head Binary Tree A B H CD E F GI
  • 22. From General Tree (Program) General Tree (Linked List) A B Head CD F G H I E Binary Tree (Linked List) Head A B D E F C I G H
  • 23. Make binary tree from this general tree: Exercise K L Y W M O X ZR N P Q
  • 24. Make binary tree from this statement: • K, C, P, E, M, B, R, G, Q, F, W • E = A + BDH – F G - K Exercise
  • 25. Contact Person: Adam Mukharil Bachtiar Informatics Engineering UNIKOM Jalan Dipati Ukur Nomor. 112-114 Bandung 40132 Email: adfbipotter@gmail.com Blog: http://adfbipotter.wordpress.com Copyright © Adam Mukharil Bachtiar 2012