Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Trees Directed or Undirected Graphs?

I have read that Trees are special cases of Graphs. Graphs can be directed or undirected. But if we consider tree as a data structure is it directed or undirected graph?

like image 723
Faizan Avatar asked Jan 14 '13 09:01

Faizan


People also ask

Are all trees directed graphs?

Unless qualified otherwise, trees in Mathematics or Graph Theory are usually assumed to be undirected, but in Computer Science or Programming or Data Structure, trees are usually assumed to be directed and rooted.

Is binary tree is directed or undirected?

It is also possible to interpret a binary tree as an undirected, rather than a directed graph, in which case a binary tree is an ordered, rooted tree. Some authors use rooted binary tree instead of binary tree to emphasize the fact that the tree is rooted, but as defined above, a binary tree is always rooted.

What are directed and undirected trees?

An undirected graph with no cycles is a forest and if it is connected it is called a tree. A directed graph is a forest (or tree) if when all edges are converted to undirected edges it is undirected forest (or tree). A rooted tree is a tree with one vertex designated as the root.

Is a tree a directed acyclic graph?

A graph with no cycle is acyclic. A forest is an acyclic graph. A tree is a connected undirected acyclic graph.


Video Answer


1 Answers

Unless qualified otherwise, trees in Mathematics or Graph Theory are usually assumed to be undirected, but in Computer Science or Programming or Data Structure, trees are usually assumed to be directed and rooted.

You need to be aware of the context of discussion.

like image 75
Lie Ryan Avatar answered Oct 30 '22 12:10

Lie Ryan