62 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 B.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amrita University B.Tech 2026
Apply
Recognized as Institute of Eminence by Govt. of India | NAAC ‘A++’ Grade | Upto 75% Scholarships | Application Deadline: 15th Jan
Amity University-Noida MBA Ad...
Apply
Ranked among top 10 B-Schools in India by multiple publications | Top Recruiters-Google, MicKinsey, Amazon, BCG & many more.
Amity University-Noida Law Ad...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amity University-Noida M.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Great Lakes Institute of Mana...
Apply
Last Date to Apply: 10th Feb | Globally Recognized by AACSB (US) & AMBA (UK) | 17.8 LPA Avg. CTC for PGPM 2025
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