A tree is a data structure that stores elements in a hierarchy.
We refer to this elements as nodes and the lines that connect them as edges.
The top node in the tree is called root.
Root is parent of its child nodes(2,3).
The nodes without any children is known as leaf nodes.
In this example our nodes have maximum of two children this is a special type of tree called Binary tree.
Applications
Binary Search Tree
Traversing Trees
Recursion
Recursion is the process of calling the method itself within the method.
Base Condition: It is a way to terminate the recursion at one point. Without this condition, the recurrence will last forever.
Java is going to remember these method calls one by one and return them in order using stacks. Everytime we give a recursive call, Java is going to keep track of the value of these variables in a stack.