51 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

Chandigarh University Admissi...
Apply
Ranked #1 Among all Private Indian Universities in QS Asia Rankings 2025 | Scholarships worth 210 CR
TAPMI MBA 2025 | Technology M...
Apply
MBA Admission Open in Technology Management and AI & Data Science | NAAC A++ | Institution of Eminence | Assured Scholarships
Sanskriti University LLM Admi...
Apply
Best innovation and research-driven university of Uttar Pradesh
Maya Devi University LLM admi...
Apply
43.6 LPA Highest Package | 5.48 LPA Average Package | 150+ Courses in UG, PG, Ph.D
Amity University, Noida Law A...
Apply
700+ Campus placements at top national and global law firms, corporates, and judiciaries
Shri Khushal Das University L...
Apply
Approved by UGC | Robust Placement Assistance
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