Count Complete Tree Nodes (LeetCode 222) | Complete tree examples | Recursive & Iterative

Nikhil Lohia โ€ข February 26, 2024
Video Thumbnail
Nikhil Lohia Logo

Nikhil Lohia

View Channel

About

I want to share with you my knowledge, that I have gained all my life. I like to see every task in your day to day life as an interesting problem to solve, and if you can understand the requirements, solving for it can become somewhat intuitive. I try to explore certain aspects of day to day life and how I can make them easier for you. This involves daily hacks, tutorials, innovations, new discoveries, experiences and all the stuff I find amusing. As a software engineer myself, I also believe that good problem solving skills can help you overcome most of the barriers in life. Programming is one of them. If you know how to approach a problem, writing a code for it in any language could be a very typical task. With this channel I aim to focus on the way to solve a problem efficiently rather than just its implementation.

Video Description

Join this channel to get access to perks: https://www.youtube.com/channel/UCT-S2ngqEBoYCM5UKuNeELg/join Actual problem on LeetCode: https://leetcode.com/problems/count-complete-tree-nodes/description/ Chapters: 00:00 - Intro 00:47 - Problem Statement 01:40 - Examples of a Complete Binary Tree 06:02 - Iterative Level Order Traversal 07:00 - Recursive Version (Dry-run of Code) 13:38 - Final Thoughts ๐Ÿ“š Links to topics I talk about in the video: Recursion: https://youtu.be/FTTHkmnvzlM Binary Tree: https://youtu.be/jxdEgfAsEg0 Tree Data Structure: https://youtu.be/6jwUjPs27Pc Level Order Traversal: https://youtu.be/9M3oCwPGamE Playlist on Trees: https://www.youtube.com/playlist?list=PLFdAYMIVJQHPswf74XJDtuWV-4BOeP65l ๐Ÿ“˜ A text based explanation is available at: https://studyalgorithms.com Code on Github: https://github.com/nikoo28/java-solutions/blob/master/src/main/java/leetcode/easy/CountCompleteTreeNodes.java Test-cases on Github: https://github.com/nikoo28/java-solutions/blob/master/src/test/java/leetcode/easy/CountCompleteTreeNodesTest.java ๐Ÿ“– Reference Books: Starting Learn to Code: https://amzn.to/3sJm8Wl Favorite book to understand algorithms: https://amzn.to/4848xJH Favorite book for data structures: https://amzn.to/3P96YBv Get started for interview preparation: https://amzn.to/44Nn5du ๐Ÿ”— To see more videos like this, you can show your support on: https://www.buymeacoffee.com/studyalgorithms ๐ŸŽฅ My Recording Gear: Recording Light: https://amzn.to/3PdsViT Microphone: https://amzn.to/3Exv83x Recording Camera: https://amzn.to/3PwyN8e Tablet to sketch and draw: https://amzn.to/3ZdKVy7 Sketching Tool: https://amzn.to/45XJEgY Laptop to edit videos: https://amzn.to/460ofDu ๐Ÿ’ป Get Social ๐Ÿ’ป Follow on Facebook at: https://www.facebook.com/studyalgos Subscribe to RSS feeds: https://studyalgorithms.com/feed/ Join fan mail: http://eepurl.com/g9Dadv #leetcode #programming #interview

You May Also Like

Boost Coding Skills with These Must-Haves

AI-recommended products based on this video

Loading...
GOLDCHAMP Portable 4 Gas Monitor for H2S, CO, LEL & O2 with High-Sensitivity Sensor, Data Storage, Triple Alarms, Large-Capacity Battery, Triple-Proof Design & Large LCD Display for Industrial Safety

GOLDCHAMP Portable 4 Gas Monitor for H2S, CO, LEL & O2 with High-Sensitivity Sensor, Data Storage, Triple Alarms, Large-Capacity Battery, Triple-Proof Design & Large LCD Display for Industrial Safety

(0)
$111.14
FREE delivery Tue, Aug 12
Loading...
Hi.FANCY Portable Laptop Stand with Dual Cooling Fans for 14-17inch Laptops, Grey, 23.5 x 25.9 x 0.95cm

Hi.FANCY Portable Laptop Stand with Dual Cooling Fans for 14-17inch Laptops, Grey, 23.5 x 25.9 x 0.95cm

(0)
$36.99
FREE delivery Aug 18 - 28
Loading...
Laptop Stand, OMOTON Laptop Mount, Aluminum Laptop Holder Riser Stand for Desk, Compatible with MacBook Air/Pro, Dell, HP, Lenovo and All Laptops (10-15.6 inch),Silver

Laptop Stand, OMOTON Laptop Mount, Aluminum Laptop Holder Riser Stand for Desk, Compatible with MacBook Air/Pro, Dell, HP, Lenovo and All Laptops (10-15.6 inch),Silver

(9,083)
$22.99
200+ bought in past month
Loading...
BESIGN LSX7 Laptop Stand with 360ยฐ Rotating Base, Ergonomic Adjustable Notebook Stand, Riser Holder Computer Stand Compatible with Air, Pro, Dell, HP, Lenovo More 10-15.6" Laptops (Black) Recycled Claim Standard Blended

BESIGN LSX7 Laptop Stand with 360ยฐ Rotating Base, Ergonomic Adjustable Notebook Stand, Riser Holder Computer Stand Compatible with Air, Pro, Dell, HP, Lenovo More 10-15.6" Laptops (Black) Recycled Claim Standard Blended

(3,511)
$29.99
400+ bought in past month
Loading...
Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10โ€-16"

Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10โ€-16"

(1,679)
$28.49
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
Monster N-Lite 211 Wireless Earbuds๏ผŒ Bluetooth 6.0 Stereo Headphones with Noise-Cancelling Mic and LED Display, Built-in Mic for Clear Calls, Waterproof Design for Sports

Monster N-Lite 211 Wireless Earbuds๏ผŒ Bluetooth 6.0 Stereo Headphones with Noise-Cancelling Mic and LED Display, Built-in Mic for Clear Calls, Waterproof Design for Sports

(8)
$39.99
FREE delivery Tue, Nov 4
Loading...
Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Powerful Bass, Built-in Noise-Cancelling Mic for Clear Calls, LED Display, 36H Playtime, IPX5 Waterproof Design for Sports

Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Powerful Bass, Built-in Noise-Cancelling Mic for Clear Calls, LED Display, 36H Playtime, IPX5 Waterproof Design for Sports

(40)
$39.99
FREE delivery Thu, Nov 13