Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

SSOC'23 To check whether a given binary tree is balanced or not in Java,C,C++

Open SivaHarshith1303 opened this issue 2 years ago • 1 comments

@Kumar-laxmi As a part of SSOC'23 please assign me this problem I will explain the code clearly with comments. Approach : Recursion Time Complexity : O(N) Space Complexity : O(N) [ Auxiliary Stack is used here]

SivaHarshith1303 avatar Jun 09 '23 11:06 SivaHarshith1303

@Kumar-laxmi As apart of SSOC'23 pls assign me this problem I will explain the code with comments Approach 1 Inorder traversal is sorted then binary tree is balanced. Approach 2 check if maximum value in left subtree < root node minimum value in right subtree >node i will prefer Approach 2 to solve this

JSWizard1 avatar Jun 09 '23 19:06 JSWizard1

Stale issue message

github-actions[bot] avatar Jun 02 '24 16:06 github-actions[bot]