Browsed by
Category: Algorithm

Postorder Tree Traversal (DFS) in java

Postorder Tree Traversal (DFS) in java

In our previous post we had discussed about different approaches of implementing Preorder and Inorder tree traversal. In this article we shall discuss steps and different ways of implementing Postorder tree traversal.

There are different ways to traversal a tree in DFS such as:

  1. Preorder
  2. Inorder
  3. Postorder

Here in this article, we shall discuss steps and different approach of implementing Postorder tree traversal.

Read More Read More

Inorder Tree Traversal (DFS) in java

Inorder Tree Traversal (DFS) in java

In our previous post we had discussed about different approaches of implementing Preorder tree traversal. In this article we shall discuss steps and different ways of implementing Inorder tree traversal.

There are different ways to traversal a tree in DFS such as:

  1. Preorder
  2. Inorder
  3. Postorder

Here in this article, we shall discuss steps and different approach of implementing Inorder tree traversal.

Read More Read More

How to implement Quick Sort in java

How to implement Quick Sort in java

Quick sort which by name conveys sorting done quickly. It is based on Divide and Conquer as termed as Partition exchange sort. Though this sorting algorithm is not stable but it requires very less additional space and is fast. To follow its definition of divide and conquer, it first selects a pivot value and with the assistance of Pivot value list is splitting into three parts as mentioned below-

  1. Elements lesser than Pivot value
  2. Pivot Value
  3. Elements greater than Pivot value

Read More Read More