40 Views

trees in data structures and algorithms


Grag 7th Sep, 2021
Answer (1)
shikha jindal 7th Sep, 2021

In computer science, a tree is a widely used abstract data type that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes. A tree data structure can be defined recursively as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated, and none points to the root. Alternatively, a tree can be defined abstractly as a whole (globally) as an ordered tree, with a value assigned to each node. Both these perspectives are useful: while a tree can be analyzed mathematically as a whole, when actually represented as a data structure it is usually represented and worked with separately by node (rather than as a set of nodes and an adjacency list of edges between nodes, as one may represent a digraph, for instance). For example, looking at a tree as a whole, one can talk about "the parent node" of a given node, but in general, as a data structure, a given node only contains the list of its children but does not contain a reference to its parent (if any).

Related Questions

Amity University,Noida BBA Ad...
Apply
Ranked amongst top 3% universities globally (QS Rankings)
Sanskriti University BBA Admi...
Apply
BBA Admissions 2024 | 200+ Companies | Highest CTC 54 LPA | Scholarship Available
India's Biggest Liberal Arts ...
Apply
50+ Institutes, 200+ Programs, 100+ Scholarships, On-spot Admission opportunities, Cashback on application fees & much more
AIMS-ATMA 2024
Apply
National Level Entrance Test | Recognized by Over 200 Top B-Schools across India
DBS Global University B.Tech ...
Apply
Recruiters: TCS, Wipro, HCL, Infosys, Tech Mahindra etc
Amity University, Noida B.Tec...
Apply
Asia's Only University with the Highest US & UK Accreditation
View All Application Forms

Download the Careers360 App on your Android phone

Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile

150M+ Students
30,000+ Colleges
500+ Exams
1500+ E-books