Skip to content

Dipin Krishna

I love to code. If you feel the same, then i have some cool codes for you. They are simple but good to get started.

  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact
  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact

Tag Archives: Binary Tree

Home/Posts Tagged: Binary Tree
python

Python: Lowest Common Ancestor of a Binary Tree – Non Recursive

Sep 23, 2018Dipin KrishnaCoding, PythonBinary Tree, LCA, Lowest Common Ancestor, Python, Python 3

Python 3 code to find the Lowest Common Ancestor of a Binary Tree This is a Non Recursive solution using DFS method. class Node(): def __init__(self, val, left = None, right = None): self.val = val self.left = left self.right = right   class Tree(): def __init__(self, root = None): self.root = root   def

Read More

Search

Theme by Think Up Themes Ltd. Powered by WordPress.