Introduction
This is the fifth article in the Tree Traversals - Online Classes.
A very interesting problem is to find the diameter of a tree. The challenge is not in coding the algorithm but in understanding the meaning of the problem. We will try to define the problem so that visualizing the solution becomes easy.
Defining the problem - Tree Diameter
Few confusions about the diameter must be avoided before we start.
The tree diameter is always the distance between two leaf nodes
The diameter may or may not pass through the root.
The diameter can also lie on one of the two sides,...

Read More
# tree traversal

## Level Order Tree Traversal

Introduction
This is the third article in the Tree Traversals - Online Classes.
I have written many articles about non-linear data structures and their traversals. But the more you dive in you can find many more ways to traverse a tree. Here we try to solve the level order tree traversal for a binary tree and we will also try to figure out other variations of this traversal. This can we precisely extended for a n-ary tree as well.
Defining the problem
Let us consider the above tree, if we follow the blue line from root till end and print all the nodes, we will end up printing the lev...

Read More
## Hierarchical Datastructure – Iterative Tree Traversals

[nextpage title="Introduction"]
This is the second article in the Tree Traversals - Online Classes.
This is the sixth article in the series of non-linear data structures, to read more about the previous article, please check the topic Hierarchical Datastructure – Tree Traversals. To get updates on the coming articles in the series, please use the Subscribe feature on the right panel.
Purpose of article
We are already done with the constructing a binary tree and doing basic operations like creating a tree, adding a node, removing a node and all the traversals. There are situations when we...

Read More
## Hierarchical Datastructure – Tree Traversals

Introduction
This is the first article in the Tree Traversals - Online Classes.
To read more about the previous article, please check the topic Hierarchical Datastructure – Binary Tree Implementation. To get updates on the other articles in the series, please use the Subscribe feature on the right panel.
Purpose of article
This article will take over from where we wrapped up in the last article, It will define the remaining two methods elements() and positions() of the Tree ADT for LinkedBinaryTree. And we will also discuss the Tree traversals and code for the Binary Tree. We will finish...

Read More