Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
26 views

Algorithms & Data Structures 08

The document provides an overview of trees as a nonlinear data structure used to represent hierarchical data. It defines key terminology like root, internal node, external node, and subtree. It also lists some applications of trees like the Linux file system and gives an example of representing the state of a system using a tree with nodes connected by directed edges.

Uploaded by

abdh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Algorithms & Data Structures 08

The document provides an overview of trees as a nonlinear data structure used to represent hierarchical data. It defines key terminology like root, internal node, external node, and subtree. It also lists some applications of trees like the Linux file system and gives an example of representing the state of a system using a tree with nodes connected by directed edges.

Uploaded by

abdh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CS211-Algorithms & Data

Structures
Taibah University

Dr. Sameer M. Alrehaili


College of Science and Computer Engineering, Yanbu

1
Trees

2
Tree

● It is a special kind of graph


● A tree is a collection of nodes connected by directed or undirected edges.
● A tree is a nonlinear data structure.
● Is used to represent hierarchical data
● If n nodes, (n-1) edges, one edge for each parent-child relationship

3
Non-linear data structure

● Hierarchical organisation ● Linux file system

4
Terminology

● In computer science, trees are normally


displayed upside-down, with the root
forming the top level.
● A tree consists of nodes (also called
vertices or points) and edges (also
called lines or arcs).
● Root: a node without any parent
● Internal node: a node with at least one
child
● External node: (or a leaf) a node without
children
● Subtree: tree consisting of node and its
descendants

5
Applications

6
Current state is [125340678]

Represent the follower nodes in this state

UP[120345678], Down [125348670]

Left [125304678]

You might also like