Trees and hierarchies can be found everywhere. In our computers’ filesystem, in online shops’ product hierarchies, in the organizational structure of a company, in blog categories, in family trees, the structure of an html page or in geography tables managing the relation between continents, countries cities.
In this article I will describe managing those type of data structure in MySQL using the Adjacency List Model.
Recursion in computer science is an approach to solve complex problems by splitting them into smaller, similar ones. Often a defined function is being applied in it’s own definition. To not end up in an infinite loop or a stack overflow, the function definition reaches a base case, where no further recursive call occurs.