ALGORITHMS

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...

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...