Популярное

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

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

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

Топ запросов

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

Longest Duplicate Substring | TRIE | Rolling Hash | Binary Search | Leetcode

Автор: Techdose

Загружено: 2020-06-19

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

Описание:

This video explains a very important programming interview problem which is to find the longest duplicate substring in the given string.There are many ways to solve this problem.I have explained 3 methods to solve this problem.The first method is by using dynamic programming because this problem is a variant of LCS or longest common substring.DP fails because we can't make a large table.The second approach is to solve it using TRIE.In this approach, we keep inserting all substrings of given size and whenever during insertion in our trie, we finnd that the substring is already present then that must be a common substring.We apply binary search on length of substring to find the maximum length for which there are two duplicate substrings.The third approach is by using rolling hash, binary search and hashmap.This is making use of rabin karp algorithm.This is the fastest among the 3 methods explained.The fastest method to solve this problem is by using Ukkonen's suffix tree, which solves this problem in two steps in just O(N) time.I have explained all the methods with intuition and proper examples.I have also shown the code walk through at the end of the video.

CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

=================================================================
INSTAGRAM:   / surya.pratap.k  
LinkedIn:   / surya-pratap-kahar-47bb01168  
=================================================================

CODE LINK: https://gist.github.com/SuryaPratapK/...
USEFUL LINKS:-
Longest Common Substring (LCS):    • Longest common substring | Dynamic program...  

Basics of trie:    • Basics of trie  
TRIE Insertion & Search:    • Trie insertion and search  
TRIE Deletion & Search:    • Trie deletion and search  
Rolling Hash (Rabin Karp algo):    • Rolling hash | Rabin karp algorithm | Patt...  

Longest Duplicate Substring | TRIE | Rolling Hash | Binary Search | Leetcode

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

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

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

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

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

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

Последовательность перестановок | Leetcode #60

Последовательность перестановок | Leetcode #60

Word Search II | DFS + Map | DFS + TRIE | Leetcode #212

Word Search II | DFS + Map | DFS + TRIE | Leetcode #212

Largest Divisible Subset | Dynamic programming | Leetcode #368

Largest Divisible Subset | Dynamic programming | Leetcode #368

😱 АУСЛЕНДЕР: Назревает ЛЮТЫЙ замес! Китай огласил Трампу

😱 АУСЛЕНДЕР: Назревает ЛЮТЫЙ замес! Китай огласил Трампу "ценник" мира в Украине - "прайс" ЖУТКИЙ!

Rotten oranges problem | Leetcode #994

Rotten oranges problem | Leetcode #994

Алгоритмы и структуры данных за 15 минут! Вместо 4 лет универа

Алгоритмы и структуры данных за 15 минут! Вместо 4 лет универа

ЭТУ ЗАДАЧУ ИЗ 4 КЛАССА НЕ РЕШАТ ДАЖЕ СТУДЕНТЫ!!! | ПУТЬ НАИМЕНЬШЕЙ ДЛИНЫ

ЭТУ ЗАДАЧУ ИЗ 4 КЛАССА НЕ РЕШАТ ДАЖЕ СТУДЕНТЫ!!! | ПУТЬ НАИМЕНЬШЕЙ ДЛИНЫ

Count Submatrices With All Ones | Leetcode 1504 | Monotonic Stack

Count Submatrices With All Ones | Leetcode 1504 | Monotonic Stack

IP-адресация для начинающих: IP-адрес, маска сети, подсеть и NAT

IP-адресация для начинающих: IP-адрес, маска сети, подсеть и NAT

Ways to Express an Integer as Sum of Powers | Leetcode 2787 | Memoization | Tabulation

Ways to Express an Integer as Sum of Powers | Leetcode 2787 | Memoization | Tabulation

Теренс Тао о том, как Григорий Перельман решил гипотезу Пуанкаре | Лекс Фридман

Теренс Тао о том, как Григорий Перельман решил гипотезу Пуанкаре | Лекс Фридман

8.1 Trie Data Structure | Complete Introduction | Tries | All Operations with Examples

8.1 Trie Data Structure | Complete Introduction | Tries | All Operations with Examples

Самая длинная повторяющаяся подстрока | LeetCode 1044 | Алгоритм Рабина-Карпа

Самая длинная повторяющаяся подстрока | LeetCode 1044 | Алгоритм Рабина-Карпа

Karp-Rabin String Matching Algorithm | Substring Search Pattern

Karp-Rabin String Matching Algorithm | Substring Search Pattern

Alice and Bob Playing Flower Game | Leetcode 3021

Alice and Bob Playing Flower Game | Leetcode 3021

Куда исчезает пространство, если уменьшить его до Планковской длины?

Куда исчезает пространство, если уменьшить его до Планковской длины?

Reconstruct Itinerary | Leetcode #332

Reconstruct Itinerary | Leetcode #332

Minimum Window Substring - Airbnb Interview Question - Leetcode 76

Minimum Window Substring - Airbnb Interview Question - Leetcode 76

Что такое ПРЕДЕЛЫ. Математика на QWERTY

Что такое ПРЕДЕЛЫ. Математика на QWERTY

Basics of trie

Basics of trie

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



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



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