Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

Left view of Binary Tree | Right view of Binary Tree | Left view of Tree | DSA-One Course #60

55.5K views
•
November 30, 2021
by
Anuj Bhaiya
YouTube video player
Left view of Binary Tree | Right view of Binary Tree | Left view of Tree | DSA-One Course #60

TL;DR

This video explains how to print the left and right views of a binary tree by using recursion and a hashmap.

Transcript

Hey What's up guys Anuj here & welcome to DSA One course So in today's video we will be solving a question on Binary Tree which is called Print left view & then next question, right view of a binary tree so you are given a binary tree we will be doing two questions in it print left & right view before this, we saw level order traversal here we will... Read More

Key Insights

  • ↪️ The left view of a binary tree includes the nodes visible when looking at the tree from the left side, while the right view includes the nodes visible from the right side.
  • ↪️ The left and right views can be printed using recursion and a hashmap or array data structure.
  • 🎚️ Alternatively, the views can be printed by traversing the tree level by level using a queue data structure.
  • ↪️ The left and right views provide different perspectives on the binary tree and can be useful for various applications.
  • ↪️ The code provided in the video demonstrates an efficient approach to print the left and right views of a binary tree without traversing each node on a level.
  • ↪️ The code can be modified to print only the left or right view by reversing the order of traversal or updating the nodes added to the hashmap or array.
  • ↪️ The left and right views allow for a quick understanding of the overall structure of a binary tree from different angles.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the difference between the left view and right view of a binary tree?

The left view of a binary tree includes the nodes visible when looking at the tree from the left side, while the right view includes the nodes visible from the right side.

Q: How can the left view of a binary tree be printed using recursion?

To print the left view, you can use recursion and a hashmap or array. Traverse the tree using recursion and keep track of the level of each node. Add the first node at each level to the hashmap or array to get the left view.

Q: How can the right view of a binary tree be printed using recursion?

To print the right view, you can modify the code for printing the left view. Instead of adding the first node at each level, add the last node encountered at each level to the hashmap or array.

Q: Can the left and right views of a binary tree be printed using a queue data structure?

Yes, it is possible to print the left and right views of a binary tree using a queue data structure. By traversing the tree level by level, the first node encountered at each level will be the left view, and the last node encountered will be the right view.

Key Insights:

  • The left view of a binary tree includes the nodes visible when looking at the tree from the left side, while the right view includes the nodes visible from the right side.
  • The left and right views can be printed using recursion and a hashmap or array data structure.
  • Alternatively, the views can be printed by traversing the tree level by level using a queue data structure.
  • The left and right views provide different perspectives on the binary tree and can be useful for various applications.
  • The code provided in the video demonstrates an efficient approach to print the left and right views of a binary tree without traversing each node on a level.
  • The code can be modified to print only the left or right view by reversing the order of traversal or updating the nodes added to the hashmap or array.
  • The left and right views allow for a quick understanding of the overall structure of a binary tree from different angles.
  • Understanding the concepts and implementation of left and right views is essential for building efficient algorithms and solving related problems in binary tree traversal.

Summary & Key Takeaways

  • The video introduces the concept of left and right views of a binary tree, which show the nodes that are visible when looking at the tree from the left or right side.

  • The left view includes nodes visible from the left side of the tree, while the right view includes nodes visible from the right side.

  • The video provides a step-by-step explanation of how to print the left and right views using recursion and a hashmap or array data structure.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from Anuj Bhaiya 📚

Minimum Edit Distance Problem | DP | Dynamic Programming | DSA-One Course #91 thumbnail
Minimum Edit Distance Problem | DP | Dynamic Programming | DSA-One Course #91
Anuj Bhaiya

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.