a complete binary tree binary tree level possibly completely fill node far leave possibledesign algorithm insert new node complete binary tree keep complete insertionimplement CBTInserter classCBTInserterTreeNode root Initializes data structure root complete binary treeint insertint v Inserts TreeNode tree value Nodeval val tree remain complete return value parent insert TreeNodeTreeNode get_root Returns root node tree Example 1inputcbtinserter insert insert get_root1 2 3 4 outputnull 1 2 1 2 3 4explanationcbtinserter cbtinsert new cbtinserter1 2cBTInserterinsert3 return 1cBTInserterinsert4 return 2cbtinserterget_root return 1 2 3 4 ConstraintsThe number nod tree range 1 10000 Nodeval 5000root complete binary tree0 val 5000At 104 call insert get_root