ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Good Subtrees | GFG | POTD | 5th May 2023 | DFS | Java | C++ | Problem Of The Day

Автор: Prativa TECH

Загружено: 2023-05-04

Просмотров: 130

Описание: The video solves Problem Of The Day question " Good Subtrees " asked on GeeksForGeeks on 5th May 2023 .

The logic behind the approach used in the solution is based on the fact that a subtree is a subset of the binary tree rooted at a given node, and that the number of distinct values in a subtree is the number of distinct values in the union of the sets of distinct values of its left and right subtrees, as well as the value of the root node itself.

Therefore, we can traverse the binary tree using DFS and, at each node, recursively traverse its left and right subtrees to get the sets of distinct values in each subtree. We can then create a new set and add all the values from the left and right sets as well as the current node's value to it. If the size of the new set is less than or equal to k, we increment the count of good subtrees.

By the end of the traversal, the count variable will contain the number of good subtrees in the binary tree.

GFG POTD 5th May 2023 :
https://practice.geeksforgeeks.org/pr...

Java | C++ solution Code Link :
https://docs.google.com/document/d/1u...

Java Interview Series :
   • Core Java Interview Questions  

GFG POTD series :    • Problem Of The Day | 31st Jan 2023 | Geeks...  

Java -17 series :    • Java 17 - Introduction  

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Good Subtrees | GFG | POTD | 5th May 2023  | DFS  | Java | C++ | Problem Of The Day

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Another Coin Change Problem | GFG | POTD | 6h May 2023  | DP  |Java | C++ | Problem Of The Day

Another Coin Change Problem | GFG | POTD | 6h May 2023 | DP |Java | C++ | Problem Of The Day

🌹 Deep House Obsession 24/7 • Emotional Chill House Live Radio | Rose Afterhours

🌹 Deep House Obsession 24/7 • Emotional Chill House Live Radio | Rose Afterhours

Creating  Weekly Reports Using Batch Macro for a Month (User Input) || Alteryx Project #32

Creating Weekly Reports Using Batch Macro for a Month (User Input) || Alteryx Project #32

Неймовірні Українські Християнські Пісні: Ваша Духовна Подорож

Неймовірні Українські Християнські Пісні: Ваша Духовна Подорож

Автоматизация Баз Данных с Database Connectivity Toolkit | State Machine | Global Variable Feedback

Автоматизация Баз Данных с Database Connectivity Toolkit | State Machine | Global Variable Feedback

Большое путешествие по планетам Солнечной системы | Stream 24/7

Большое путешествие по планетам Солнечной системы | Stream 24/7

Арестович: Антиевропейский демарш Зеленского? Дневник войны

Арестович: Антиевропейский демарш Зеленского? Дневник войны

Понимание GD&T

Понимание GD&T

«Бесплатные деньги» ежемесячно? Почему не вводят безусловный базовый доход

«Бесплатные деньги» ежемесячно? Почему не вводят безусловный базовый доход

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

99% женщин делают ЭТО, а мужчины продолжают выдавать свои секреты #отношения #психология

99% женщин делают ЭТО, а мужчины продолжают выдавать свои секреты #отношения #психология

Problem Of The Day | 31st Jan 2023 | GeeksForGeeks | Java Soln using String | Google Interview Ques

Problem Of The Day | 31st Jan 2023 | GeeksForGeeks | Java Soln using String | Google Interview Ques

Как антивирус находит твой код? Разбираем сигнатуры на практике!

Как антивирус находит твой код? Разбираем сигнатуры на практике!

Петербург без связи из-за приезда Путина. Задержки рейсов в России. Ходорковский и Соболь в ПАСЕ

Петербург без связи из-за приезда Путина. Задержки рейсов в России. Ходорковский и Соболь в ПАСЕ

🌌 Relaxing Liquid DnB 24/7 🔴 Chill Beats Radio | LiquidHourDnB

🌌 Relaxing Liquid DnB 24/7 🔴 Chill Beats Radio | LiquidHourDnB

Маска подсети — пояснения

Маска подсети — пояснения

Analysis of Alteryx Job Postings Scraped from a Live Job Portal ||Alteryx Real Time Project #34

Analysis of Alteryx Job Postings Scraped from a Live Job Portal ||Alteryx Real Time Project #34

Алгоритмы на Python 3. Лекция №1

Алгоритмы на Python 3. Лекция №1

Terminal 1987 Never Closed — 24/7 Synthwave Dev Stream

Terminal 1987 Never Closed — 24/7 Synthwave Dev Stream

MENTZEN GRILLUJE #80: Trump w Davos

MENTZEN GRILLUJE #80: Trump w Davos

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]