Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder

  • Coding Simplified
  • 2020-09-03
  • 4684
BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder
  • ok logo

Скачать BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

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

Cкачать музыку BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео BST - 14: Check if there exists a pair for given Sum in BST | Using Set | Using Inorder

Source Code: https://thecodingsimplified.com/check...
Solution - 1
Traverse BST in preorder manner
Initialize a Haseset
For any node, check if sum - node.data present in set or not
If it present, return true, else add current node value in set
Traverse every node in tree & check above

Time Complexity: O(n)
Space Complexity: O(n)

Solution - 2
Traverse BST in inorder
While Traversing in inorder, keepon adding value as well in list as well
After traversing, we'll have sorted array/list
Now take two variable start & end, start will point to o index & end will point to last index
Get sum of values present at start & end index
If CurrentSum is equal to given sum, return true.
If CurrentSum is less than given sum, increase start by 1.
If CurrentSum is greater than given sum, decrese the end by 1

Time Complexity: O(n)
Space Complexity: O(n)

For more info, please see the video.

CHECK OUT CODING SIMPLIFIED
   / codingsimplified  

★☆★ VIEW THE BLOG POST: ★☆★
http://thecodingsimplified.com

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 500+ videos.

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★
https://www.youtube.com/codingsimplif...

★☆★ Send us mail at: ★☆★
Email: [email protected]

Комментарии

Информация по комментариям в разработке

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

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

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