ALGORITHMS

In this article we will see some more complex binary tree traversal and different techniques for same traversal. This article will contain following implementations:

  1. Reverse level order traversal
  2. Leaf node traversal
  3. Boundary node traversal
  4. Morris in-order traversal
Implementation:

1....

Continue reading...

Binary Search Tree (BST) is a basic data structure that stores items in a binary tree so that few operations on items like addition, searching, deletion could be done efficiently.

Also Known As:

Ordered/Sorted Binary Tree

Properties of BST:
  1. The left subtree of a node contains only nodes w...

Continue reading...

1. BST to sorted list:

In-order traversal of a BST gives us sorted list. In-order traversal could be done by recursively of iteratively.

Recursive In-order traversal:

private void inOrderRecursive(Node node, List list) {
    if(null == node) return;
    inOrderRecursive(node.left, lis...

Continue reading...

At first enlighten yourself about Heap. Heap is a tree based data structure with heap property. Binary Heap is a very common implementation of heap data structures. Once you learn Binary Heap your eagerness to learn some advance Heap data structures will definitely increase. Two other advance he...

Continue reading...

Trie is one of my favourite data structures because its easy understand application of Trie and easy to implement as well. In case you don't know Trie comes from the word Retrieval because Trie can retrieve several words given prefix of the word. One most common usage of Trie that comes in mind...

Continue reading...