+ All Categories
Home > Documents > Introduction to Trees

Introduction to Trees

Date post: 13-Sep-2015
Category:
Upload: rajendran
View: 9 times
Download: 0 times
Share this document with a friend
Description:
Introduction to Trees
Popular Tags:
9
Introduction to Trees Lecture 16 1107186 – Estrutura de Dados – Turma 02 Prof. Christian Azambuja Pagot CI / UFPB Universidade Federal da Paraíba Centro de Informática
Transcript

Introduction to TreesLecture 161107186 Estrutura de Dados Turma02Prof. Christian Azambuja PagotCI / UFPBUniversidade Federal da ParabaCentro de InformticaWhat is a Tree?In graph theory, a tree is defined as aconnectedExample:acyclicgraph.Node4However, one suchgraph may generatedifferent treedata structures!2Edge15362Universidade Federal da ParabaCentro de InformticaWhat is a Tree?In graph theory, a tree is definedas aRoot nodeconnectedExample:acyclicgraph.4412152543633Universidade Federal da ParabaCentro de InformticaWhat is a Tree?In graph theory, a tree is definedas aconnectedExample:acyclicgraph.Root node1422564153364Universidade Federal da ParabaCentro de InformticaDefinitionsPath LengthNumber of edges on a path.1Depth of a NodeEqual to the path length to the root.8372Height of a NodeEqual to the path length from thenode to its deepest descendant.Height of a Tree49Equal to the heightof the root.565Universidade Federal da ParabaCentro de InformticaDefinitionsChild NodeEach node canchild nodes.Parent Nodehaven18372It is unique fornode.The root does parent node.each49not have566Universidade Federal da ParabaCentro de InformticaDefinitionsLeaf NodeHas no child node.1SiblingsNodes with the sameparent.8372AncestorsAll nodes on the pathto the root.49Descendants of a node nAll nodes that share n as anancestor.567Universidade Federal da ParabaCentro de InformticaDefinitionsSubtreeTree formed by a node1andallitsdescendants.837249568Universidade Federal da ParabaCentro de InformticaDefinitionsTree Arity11n-ary.Binary.2383724495656n-ary treebinary tree9Universidade Federal da ParabaCentro de Informtica


Recommended