What’s happening everyone? This is the latest addition to my brand new series Graph Theory: Go Hero where we discuss about graphs and related algorithms, in depth. Check it out for a quick overview. Here we’re going have a light introduction to tree which is a kind of graph. So, here we go.
What is a tree?
We have a couple of graphs above, can you spot the odd one out?
Correct, the forth one stands out of the group. But why?
Because a tree is an undirected graph with no cycles. The key thing to remember is trees aren’t allowed to have cycles in it. You could find one that broke the rule, right? Excellent job.
However, there’s another simple method which we can use to see whether the given graph is a tree or not. All trees have **N - 1 edges, **where N is the number of nodes.
Three of our graphs meet the rule, right? But the last one doesn’t.
Let’s see a couple of occasions where we encounter the applications of trees.
A computer file system contains directories, subdirectories and files and it’s inherently a tree.
The term corporate hierarchy refers to the arrangement and organization of individuals within a corporation according to power, status, and job function. It delineates authority and responsibility, designating leadership over employees, departments, divisions, and other executives depending on their place within the strata. A complete corporate would have a tree structure.
Tress could be used to decompose mathematical expressions and source code into an abstract format so that they are evaluated in a formal way. Below is an expression and it’s corresponding tree representation.
(a * b) + (c - d)
Every web page we visit is made of certain tags such as ,
#programming #computer-science #graph-theory #deep learning #deep learning