using System.Collections.Generic;
public static void Main()
BinaryTree tree = new BinaryTree();
root = tree.insert(root, 4);
Console.WriteLine("Minimum value of BST is "
Console.WriteLine("Height of tree is "
public class BinaryTree {
public virtual Node insert(Node node, int data)
node.left = insert(node.left, data);
node.right = insert(node.right, data);
public virtual int minvalue(Node node)
while (current.left != null) {
public int maxDepth(Node node)
int lDepth = maxDepth(node.left);
int rDepth = maxDepth(node.right);
Queue<Node> q = new Queue<Node>();
if (temp.right != null) {
public static Node KthLargestUsingMorrisTraversal(Node root, int k)
while (succ.left != null && succ.left != curr)