Data Structures


Binary Tree Sep 24, 2017


    //In-Order traversal
    void inOrderTraversal(TreeNode node)
    {
        if(node != null)
        {
            inOrderTraversal(node.left);
            visit(node);
            inOrderTraversal(node.right);
        }
    }
    //Pre-Order traversal
    void preOrderTraversal(TreeNode node)
    {
        if(node !=null )
        {
            visit(node);
            preOrderTraversal(node.left);
            preOrderTraversal(node.right);
        }
    }
    //Post-Order traversal
    void postOrderTraversal(TreeNode node)
    {
        if(node !=null )
        {
            postOrderTraversal(node.left);
            postOrderTraversal(node.right);
            visit(node);
        }
    }

Binary Heaps Sep 24, 2017

Feature: Each node is smaller than its children. The root is the minimum element in the tree.

Trie Jan 21, 2018


Back
Home
Top