Тёмный

(Remade) Binary Tree Paths | Depth First Search | Leetcode 257 

Nideesh Terapalli
Подписаться 7 тыс.
Просмотров 3,1 тыс.
50% 1

Topic: Depth First Search
Time Complexity: O(n)
Space Complexity: Output Size
Code:
github.com/Nideesh1/Algo/blob...
Leetcode:
leetcode.com/problems/binary-...
Note I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.
Credit to : Leetcode Solution leetcode.com/problems/binary-...
A fantastic tool to help visualize algorithms: algorithm-visualizer.org/
Their github link: github.com/algorithm-visualiz...
Hey there! Just wanted to let you know that some of the below links in this video description are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!
Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link)
Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link)
Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?af... (affiliate link)

Опубликовано:

 

5 апр 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@varanasibindu8987
@varanasibindu8987 Год назад
ThankYou for the video, very good explanation
@srinish1993
@srinish1993 4 года назад
Thanks for the video kingnids:) I guess placing the statements to add path to resList before making dfs calls for left and right Node will be easier to view. void dfs(List res, Node root, String path){ if(root == null) return; path += Integer.toString(root.val); if(root.left == null && root.right == null) { res.add(path); } dfs(res, root.left, path+'->'); dfs(res, root.right, path+'->'); }
@NideeshTerapalli
@NideeshTerapalli 4 года назад
Yup you're right it's cleaner. Thanks Srinish
@kentsang9376
@kentsang9376 3 года назад
Very clear explanation!!
@ivailotenevv
@ivailotenevv 4 года назад
Hey Nideesh, you are really good teacher! Thank you for your videos! Keep uploading :)
@NideeshTerapalli
@NideeshTerapalli 4 года назад
Thanks!
@hemaladani4510
@hemaladani4510 3 года назад
Hello Nideesh, Beautiful explanation. Best part is visualization. BTW, how did you do that?Thank you so much!
@NideeshTerapalli
@NideeshTerapalli 4 года назад
0:00 Input/Output 1:04 Shared DataStructure vs Separate String Copies 3:50 Algorithm Visual 4:18 Code and Complexities Hey there! Just wanted to let you know that some of the links in this comment are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own! Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link) Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link) Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?aff=K1z6 (affiliate link)
@chodingninjas7415
@chodingninjas7415 4 года назад
Make some new videos bro
@NideeshTerapalli
@NideeshTerapalli 4 года назад
Yeah bro I'm at home now mostly, so I have time
Далее
Binary Tree Paths
7:53
Просмотров 42 тыс.
A* Search
12:32
Просмотров 398 тыс.
ИСЧЕЗНОВЕНИЕ МОНЕТЫ (секрет)
00:46
3M❤️ #thankyou #shorts
00:16
Просмотров 7 млн
Print all ROOT to LEAF paths in a binary tree
13:37
Просмотров 40 тыс.
Path Sum III | leetcode 437 | Hindi
18:40
Просмотров 23 тыс.
How Dijkstra's Algorithm Works
8:31
Просмотров 1,3 млн