Find the Max element in a Given Binary Tree

Objective: – Given a binary tree , Find the max element in it.

Example:

Find the Max element in a Given Binary Tree

Approach:

  • Use Recursion.
  • Max will the Max(root, max element in the left subtree, max element in right subtree)
  • Recursively solve for the max element in the left subtree and right subtree.

Complete Code:

Output:

Max element in Binary Tree: 35

4 thoughts on “Find the Max element in a Given Binary Tree”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.