Category Archives: Algorithms

Invert binary tree – iterative method

This problem is famous due to the wellknown twett, by Max Howell. I can not say it is hard or easy. Here just provide the iterative method as recursive method is really too easy. In general,  you just need to swap … Continue reading

Posted in Algorithms, Tech | Leave a comment

Iterative Method to check if the Binary Search Tree is valid

Problem Description: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The … Continue reading

Posted in Algorithms | Leave a comment

Core algorithm in real projects

Posted in Algorithms | Leave a comment