Difference between revisions of "Trees"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Connected)
(Undirected)
Line 8: Line 8:
  
 
===Undirected===
 
===Undirected===
 +
A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.
  
 
===No Cycles===
 
===No Cycles===

Revision as of 10:01, 29 November 2017

Tree-1.jpg

What is a Tree

A tree is a connected, undirected graph with no cycles in it.

Connected

All nodes must be connected to other nodes so that no part of the graph is separated. An unconnected graph is essentially 2 separate graphs.

Undirected

A tree can't have any directed edges/arcs. This will be an arrow on the edge/arc to indicate the direction of travel.

No Cycles

What is a Rooted Tree

A tree with one vertex singled out as a starting point.

What is a Binary Tree

A binary tree is a graph with no cycles in which each node is succeeded by a maximum of 2 nodes, a 'left' child and a 'right' child, therefore they can be either directed or undirected.

What is a Binary Tree Search