Level order traversal of Binary Tree | Step by step demo with example | Study Algorithms
Nikhil Lohia
View ChannelAbout
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.
Latest Posts
Video Description
When you look at a binary tree, the first thing you might see is that each node is at a different height. This simply implies that you can traverse the tree level by level as well. For each level you go left to right, hence the element that is seen first should be processed first. Given this information we can take the help of a queue data structure to perform a level order traversal of binary tree. Watch this video to see a step by step procedure with a code sample written in JAVA. Chapters: 00:00 - Intro 01:10 - What is level order traversal? 03:55 - Logic of level order traversal 09:32 - Dry-run of code 13:31 - Final Thoughts π Links to topics I talk about in the video: Understanding a Binary Tree: https://youtu.be/6jwUjPs27Pc Queue Data Structure: https://youtu.be/j-lKqN_NNUE 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/util/TreeNode.java π Reference Books: Starting Learn to Code: https://amzn.to/36pU0JO Favorite book to understand algorithms: https://amzn.to/39w3YLS Favorite book for data structures: https://amzn.to/3oAVBTk Get started for interview preparation: https://amzn.to/39ysbkJ π 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/3pAqh8O Microphone: https://amzn.to/2MCX7qU Recording Camera: https://amzn.to/3alg9Ky Tablet to sketch and draw: https://amzn.to/3pM6Bi4 Surface Pen: https://amzn.to/3pv6tTs Laptop to edit videos: https://amzn.to/2LYpMqn π» Get Social π» Follow on Facebook at: https://www.facebook.com/studyalgos Follow on Twitter at: https://www.twitter.com/studyalgorithms Follow on Tumblr at: https://studyalgos.tumblr.com/ Subscribe to RSS feeds: https://studyalgorithms.com/feed/ Join fan mail: http://eepurl.com/g9Dadv #binarytrees #programming #traversal
Boost Your Coding Skills
AI-recommended products based on this video























