1110. Delete Nodes And Return Forest | DFS | Tree

  Рет қаралды 4,459

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 8
@dhruvgoel25
@dhruvgoel25 4 ай бұрын
Nice explanation 👍
@adarshjain3058
@adarshjain3058 6 ай бұрын
aaj aapse pehle subha uth kar question kar liyaaa😌
@AnujKshatriya09
@AnujKshatriya09 6 ай бұрын
👍👍
@AxeCap73
@AxeCap73 6 ай бұрын
Sir please make a video on minimum swaps to make palindrome ( with concrete proof).
@GopiVSOnline
@GopiVSOnline 6 ай бұрын
@aryan I have a doubt what if we removed a node which contains the another node to remove?
@ArhamSheikh-kl1bo
@ArhamSheikh-kl1bo 6 ай бұрын
This can also be solved using postorder traversal
@Ayush37262
@Ayush37262 6 ай бұрын
11:02 Arey bhai khena kya chahte ho 😢
@dayashankarlakhotia4943
@dayashankarlakhotia4943 6 ай бұрын
class Solution { private boolean []set=new boolean[1001]; private Listans=new ArrayList (); public ListdelNodes(TreeNode root,int[]to_delete){ for(int j:to_delete) set[j]=true; if(dgf(root)!=null){ ans.add(root); } return ans; } private TreeNode dfs(TreeNode root){ if(root==null) return null; root.left =dfs(root.left); root.right =dfs(root.right); if(!set[root.val]) return root; if(root.left!=null) ans.add(root.left); if(root.right!=null) ans.add(root.right); return null; } } 🎉❤
979. Distribute Coins in Binary Tree | Tricky DFS | Recursion
17:24
Aryan Mittal
Рет қаралды 4,8 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
How I Interviewed Candidates at Google
5:09
NeetCodeIO
Рет қаралды 81 М.
3439. Reschedule Meetings for Maximum Free Time I | Sliding Window
15:49
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 276 М.
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 575 М.
Delete Nodes and Return Forest
14:48
Kevin Naughton Jr.
Рет қаралды 31 М.
974. Subarray Sums Divisible by K | PrefSum | Not an Easy Problem
17:19
The SHOCKING Truth About Who Should NOT Code! 🤫
11:50
Aryan Mittal
Рет қаралды 1,9 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН