Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Tree data structures

In organizing data objects, a powerful tool called tree data structure may be used.
This tool is based on keys. When the data stored within the tree is keyed or has
internal structure that allows one element to be related to, or ``saved within''
another, it proves to be a great replacement to arrays.

Social networking often uses trees, while PDF is a tree based format. Computer
chess games build a huge tree to reach an optimal move or strategy plan. Producers
and consumers often use a balanced tree implementation to store a document in
memory.

In my own opinion, the application of tree data structures is very user-friendly. The
common uses of tree are: it can manipulate hierarchical data and sorted lists of
data, make information easy to search, can be used as a workflow for compositing
digital images for visual effects and lastly, it can be used as to router algorithms.

As mentioned above, tree data structures are preferred when one needs to
organize multiple data objects in terms of hierarchal relationships; examples would
be family tree, tree of species relating to botany or zoology, etc. Moreover, trees
can hold objects, sorted by their keys. Arranging the nodes in an orderly manner is
important. So that, all keys in a node's right sub tree are greater than the key of the
object at the node, and all keys in a node's left sub tree are less than the key of the
object at the node. We call such a tree an ordered tree or a search tree. Also, trees
can hold sequenced objects that are located by keys. The data keys are sequences,
and the sequences label the branches of a tree that holds the data. Moreover, a tree
can represent a structured object that is similarly organized like the sequenced
objects.

Phrase structure of sentences, which is crucial to language processing programs,


can also be represented in a tree. This is called a parse tree. The Java compiler
checks the grammatical structure of a Java program and then attempts to build the
program's own parse tree. The success of the programs parse tree leads to the Java
compilers benefit. It helps the Java compiler generate the byte code that one finds
in the program's class file. Here is the phrase-structure tree (``parse tree'') for the
Java statements

int x;
x = 3 + y;

STATEMENT SEQUENCE
/ \
DECLARATION ASSIGNMENT
/ \ / \
TYPE VARIABLE VARIABLE EXPRESSION
| | | / | \
int x x NUMERAL + VARIABLE
| |
3 y
A simplified tree data structure is a binary tree. Each node of the binary tree has at
most two branches. One node is allowed but more than two nodes are considered
void. The importance of a binary tree is that it can create a data structure that
mimics a Boolean-like, "yes/no" decision making process. For example, if you
construct a binary tree to store numeric values such that each left sub-tree contains
larger values and each right sub-tree contains smaller values then it is easy to
search the tree for any particular value.

In my opinion, the best research tree is a binary search tree. The particular value
being sought out is achieved faster because of the minimal nodes per branch.
Pictures of a binary tree are showed below.

The algorithm is simply a tree search equivalent of a binary search:

Start at the root


REPEAT until you reach a terminal node
IF value at the node = search value
THEN found
IF value at node < search value
THEN move to left descendant
ELSE move to right descendant
END REPEAT
Graph theory

Graph theory is the study of graphs. Graphs are mathematical structures


representing relations between objects. A graph, in this context of data structures,
is made up of vertices, nodes, or points which are connected by edges, arcs, or
lines. It may be undirected having no distinction whether the two vertices are
associated with each edge. Also, it may be directed having its edges connected
from one vertex to another. Graphs are one of the prime objects of study in discrete
mathematics.
The applications of graph theory cross different fields of study such as:
mathematics, physics, biology, etc. One of these fields is computer science. Graphs
are used to represent networks of communication, data organization, computational
devices, the flow of computation, etc. in the field of computer sciences. For
instance, the link structure of a website can be represented by a directed graph,
linking one web page to another. The development of algorithms to manipulate
graphs is a major interest in computer science.

A graph drawing should not be confused with the graph itself (the abstract, non-
visual structure) because there is no universal way in constructing a graph. The
main concern in making graphs is the connection and logical flow between vertices
and edges and not the design or layout of the graph. Graphs are represented
visually by drawing a dot or circle for every vertex, and drawing an arc between two
vertices if they are connected by an edge. If the graph is directed, the direction is
indicated by drawing an arrow.

The data structure used to store graphs in a computer system depends on both the
graph structure and the algorithm of the graph. Theoretically, one can choose
between list and matrix structures but in concrete applications the best structure is
a combination of both. List structures are often preferred for sparse graphs, as
mentioned above sparse is the phrase structure of sentences, due to smaller
memory requirements. This includes the incidence list, an array of pairs of vertices,
and the adjacency list, which separately lists the each vertex. Matrix structures on
the other hand provide faster process for certain applications but consume large
memory space. It includes the incidence matrix, a matrix of 0's and 1's; its rows
representing the vertices and its columns representing the edges, and
the adjacency matrix, where both rows and columns are indexed by vertices.

Even though almost three centuries have passed after the first paper in the history
of graph theory written by Leonhard Euler on the Seven Bridges of Knigsberg was
published, problems arose in graph theory; concerning the enumeration, sub
graphs, graph coloring problems like ErdsFaberLovsz conjecture and total
coloring conjecture which are still unsolved up to present, route problems, network
flow etc.
References
Bondy, J., & Murty, U. (2008). Graph Theory. ISBN 978-1-84628-969-9.

Chartrand, G. (1985). Introductory Graph Theory. ISBN 0-486-24775-9.

(internet):

http://www.i-programmer.info/
http://people.cis.ksu.edu/
http://stackoverflow.com/

You might also like