What is time complexity of the algorithm used in the video?

I have also implemented the isbalanced function and i am not sure if it is correct as i have used a top-down approach. Please also discuss the time complexity of my algorithm. https://ide.codingblocks.com/s/240163

O( N* N )
height function being called on all nodes and then isBalanced is being called for each node