Tree: Height of a Binary Tree

Sort by

recency

|

990 Discussions

|

  • + 0 comments

    node:internal/streams/writable:474 throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (6) at _write (node:internal/streams/writable:474:13)

    getting this though solution is fine :/

  • + 0 comments

    I've consistently been getting "We couldn't process your submission" errors for a solution that passes all tests for several days in a row.

  • + 0 comments

    def height(root): if root is not None: left_height = height(root.left) right_height = height(root.right) return max(left_height, right_height) + 1 else: return -1

    py code

  • + 0 comments

    I'm sorry what sort of boilerplate code is this supposed to be in C#??? I even know the solution to this but I can't even run...

    static int getHeight(Node root) {
    	// write code here
    }
    

    Testing a dummy case like

     if(root.Left == null && root.Right == null) {
            return 0;
        }
        return 1;
    

    gives COMPILATION errors:

    Solution.cs(1,22): error CS0246: The type or namespace name 'Node' could not be found (are you missing a using directive or an assembly reference?)
    Solution.cs(1,12): warning CS8321: The local function 'getHeight' is declared but never used
    

    Isn't root supposed to be initialized and passed by wrapper code???

  • + 0 comments

    Hello Everyone, if you have the aim of retrieving your lost stolen crypto Message Watchdogs Guard Team on Whats App. plus15 4 0 7 1 7 2 6 8 5