This video explains a very important programming interview problem which is to count the number of nodes in a given complete binary tree.This problem seems to be very simple if we are allowed to solve in O(N) linear time by using simple recursion, inorder, preorder, postorder traversal techniques.But can we improve the time complexity to logarithmic time? In this video i have shown how we can improve the time complexity by using the property of complete binary tree.The time complexity of the efficient approach is O(logN * logN).I have explained the algorithm using proper examples and code is explained at the end of the video. CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
=================================================================
INSTAGRAM: [ Ссылка ]
LinkedIn: [ Ссылка ]
WEBSITE: [ Ссылка ]
=================================================================
CODE LINK: [ Ссылка ]
OTHER PROBLEMs:-
Search in a Binary Search Tree: [ Ссылка ]
Invert Binary Tree: [ Ссылка ]
Cousins in a binary tree: [ Ссылка ]
Count Complete Tree Nodes | Leetcode #222
Теги
programming interview questionscoding interview questionsprogramming tutorialscomputer sciencegeeksforgeeksprogrammingleetcodeleetcode solutiontech doseCount Complete Tree NodesLeetcode 222complete binary treefull binary treecount nodescomplete treecount nodes in logarithmic timetree traversalbinary search on treedivide & conquerrecursionday 23june challengetree interview question