6 views

Uploaded by ashodhiya14

PPt on binary tree

- C Code for n-ary tree
- D3-Tips-and-Tricks.pdf
- Threaded Binary Trees
- Trainz Content Creator Plus Manual 1
- lec3.pdf
- Priority q and Heapsort
- Wall Thickness CATIA V5
- Check for Majority Element in a Sorted Array _ GeeksforGeeks
- Data Structures for Range Searching
- Character Based Method -Unit 1 CMB
- A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python).pdf
- Edu Cat en Kwa Ff v5r19 Toprint
- Binary Tree Print Sequence
- Adding an Edge between a Node and its Descendant of a Complete K-ary Linking Pin Structure Maximizing Total Shortening Distance
- ALV
- Binary Search Tree Java2
- 22_uf
- 06200359 (1)
- C & Data-struct
- Data Structures and Algorithm Questions

You are on page 1of 13

A binary tree:

No node has more than two child nodes (called child

subtrees).

Child subtrees must be differentiated, into:

Left-child subtree

Right-child subtree

A search tree:

For every node, p:

All nodes in the left subtree are < p

All nodes in the right subtree are > p

Binary Search Tree - Example

Alex

Alex

Angela

Angela Abner

Abner

Abigail

Abigail

Adela

Adela

Adam

Adam Agnes

Agnes

Alice

Alice

Allen

Allen

Audrey

Audrey

Arthur

Arthur

Binary Search Trees (cont)

Searching for a value is in a tree of N nodes

is:

O(log N) if the tree is balanced

O(N) if the tree is unbalanced

Unbalanced Binary Search Trees

Below is a binary search tree that is NOT

balanced

Alex

Alex

Angela

Angela

Abner

Adam

Abigail

Abigail

Adela

Adela

Adam

Abner

Agnes

Agnes

Alice

Alice

Allen

Allen

Audrey

Audrey

Arthur

Arthur

Properties of Binary Trees

A binary tree is a full binary tree if and only

if:

Each non leaf node has exactly two child nodes

All leaf nodes have identical path length

It is called full since all possible node slots

are occupied

A Full Binary Tree - Example

Full Binary Trees

A Full binary tree of height h will have

how many leaves?

A Full binary tree of height h will have

how many nodes?

Complete Binary Trees

A complete binary tree (of height h)

satisfies the following conditions:

Level 0 to h-1 represent a full binary tree of

height h-1

One or more nodes in level h-1 may have 0, or

1 child nodes

If j,k are nodes in level h-1, then j has more

child nodes than k if and only if j is to the left

of k

Complete Binary Trees - Example

B

B

A

A

C

C

D

D

E

E

H

H

I

I

J

J

K

K

F

F

G

G

Figure 13.8 A complete binary tree Figure 13.8 A complete binary tree

Complete Binary Trees (cont)

Given a set of N nodes, a complete binary

tree of these nodes provides the maximum

number of leaves with the minimal average

path length (per node)

The complete binary tree containing n

nodes must have at least one path from root

to leaf of length log n

Height-balanced Binary Tree

A height-balanced binary tree is a binary

tree such that:

The left & right subtrees for any given node

differ in height by no more than one

Note: Each complete binary tree is a height-

balanced binary tree

Height-balanced Binary Tree - Example

N

M

N-M<=1

Height balanced is a local property

Advantages of Height-balanced Binary Trees

Height-balanced binary trees are balanced

Operations that run in time proportional to

the height of the tree are O(log n), n the

number of nodes with limited performance

variance

Variance is a very important concern in real

time applications, e.g. connecting calls in a

telephone network

- C Code for n-ary treeUploaded byveeru117
- D3-Tips-and-Tricks.pdfUploaded bybharathc89
- Threaded Binary TreesUploaded byAnonymous V7P5fNQI
- Trainz Content Creator Plus Manual 1Uploaded byAndrei Chirilescu
- lec3.pdfUploaded byALEX SAGAR
- Priority q and HeapsortUploaded byNarendra Chindanur
- Wall Thickness CATIA V5Uploaded bysqaiba_g
- Check for Majority Element in a Sorted Array _ GeeksforGeeksUploaded byNiraj Kumar
- Data Structures for Range SearchingUploaded byMuhedin Hadzic
- Character Based Method -Unit 1 CMBUploaded byKarthika
- A Complete Tutorial on Tree Based Modeling from Scratch (in R & Python).pdfUploaded byTeodor von Burg
- Edu Cat en Kwa Ff v5r19 ToprintUploaded byoktavija18
- Binary Tree Print SequenceUploaded bysapaaa01
- Adding an Edge between a Node and its Descendant of a Complete K-ary Linking Pin Structure Maximizing Total Shortening DistanceUploaded byIDES
- ALVUploaded byYan Marco Soldevilla Luque
- Binary Search Tree Java2Uploaded bySushmita Ghangas
- 22_ufUploaded byrafsanteto
- 06200359 (1)Uploaded bybinukiruba
- C & Data-structUploaded bysuryakiran0706
- Data Structures and Algorithm QuestionsUploaded byMuhammad Saqib
- lecture10_RBTUploaded bySomya Arya
- CS301SolvedMCQsUploaded byMuhammadRizwanIslamKhan
- 10.1.1.100.7796Uploaded by_RAJMEHTA
- Review_8Uploaded byWalid_Sassi_Tun
- Distributed Tree KernelsUploaded byravigobi
- Performance and Reliability Analysis wAcyclic GraphsUploaded byMelvin Carter
- 4.3 an Application of Binary Trees_ Huffman Code Construction (1)Uploaded byAddisuBantayehu
- Verifiable Data StructuresUploaded byJonny Dubowsky
- A NOVEL ALGORITHM FOR MINING CLOSED SEQUENTIAL PATTERNSUploaded byLewis Torres
- Malik Lec2Uploaded byAristofanio Meyrele

- Euler GrpahUploaded byashodhiya14
- Differentical Equations lecture notesUploaded byashodhiya14
- Lecture 1Uploaded byashodhiya14
- Mathematical Hard Problems in CryptographyUploaded byashodhiya14
- Amortized Splay TreesUploaded byashodhiya14
- Sets and Funcctions, CardinalityUploaded byashodhiya14
- AES goodUploaded byashodhiya14
- 04RSAUploaded byashodhiya14
- Algorithm LecturesUploaded byashodhiya14
- Introduction NmUploaded byashodhiya14
- Number Theory Lecture 1Uploaded byashodhiya14
- Cardinality of seytsUploaded byashodhiya14
- Learning to Program in MathematicaUploaded byashodhiya14
- Trees Good sourceUploaded byashodhiya14
- Mathematica for Rogawski's Calculus 2nd Editiion -CompleteUploaded byDma Chem Eng
- Mathematical AbilityUploaded byashodhiya14
- Ma Thematic A Tutorial BeginnerUploaded byLuis Francisco Mendoza

- Lect 1Uploaded byanushreejazzz
- JMSLUploaded bymaximin
- Methods to Determine Pore PressureUploaded byAdam Bachtiar Sa'ban
- Add Maths Perfect Score Module Form 4 Set 2 p1Uploaded byYeow Pow Choo
- Cg101pc Labscope ManualUploaded byMike Bieringer
- Data Mining and Knowledge Discovery via Logic-Based Methods_ Theory, Algorithms, And Applications [Triantaphyllou 2010-06-28]Uploaded bytruekhan
- 5) DOE Design and Analysis Using MinitabUploaded byLibyaFlower
- ExcelUploaded bymahboobiqbal09
- Lab Manual Physics XIUploaded bySoubha Chakraborty
- Diagrama de MoodyUploaded byCircus_Maximus
- Tunnel Face Stability Analysis in Soft Ground in Urban Tunneling by EPB Shield.Uploaded byChin Thau Wui
- Vibration Analysis of 2 WheelerUploaded byvivekpattni
- Soot Formation in Diesel Engines By Using CfdUploaded byAnonymous 7VPPkWS8O
- Micro-FGM-pull-inUploaded byhmsedighi459
- SteEC_11_08Uploaded byJackson
- Mit18 100bf10 Dvl StrcsUploaded bySoufiane Elabed
- SCIENTIA MAGNA. International Book Series (vol. 11, no. 1)Uploaded byMia Amalia
- Sqc ProblemsUploaded byvarun1785
- Artificial Neural Networks an Econometric PerspectiveUploaded byHector Aguilar Torres
- Test 1 March-june 2012 Completed SchemeUploaded byMohd Khairudin Abdul Radzak
- Gears.pdfUploaded bychandra
- GSAS ManualUploaded byPrince Oma
- Special Relativity Midterm ExamUploaded byJoseph Nelson
- Lessons From..BURNCALUploaded byTopan Setiadipura
- 10.pdfUploaded byanderson
- Statics 3Uploaded byguptaranjeet40
- Non Linear ProjectUploaded byKenaia Adeleye
- Saliency UFO Iccv13Uploaded byAnonymous b2k9ABe7e
- Monte Carlo LecturesUploaded byTristanPil
- First ProofsUploaded byNatasha Chandra