DFS of an Acyclic & Cyclic Graph in Arabic - Problem Solving بالعربي

  Рет қаралды 568

Ahmed Elemam

Ahmed Elemam

Күн бұрын

Data structures and algorithms in Arabic with Omar Morsy ‪@omarmorsy02‬
Graph
Depth-First Search
workat.tech/pr...
workat.tech/pr...
‏ ⁦‪ / @omarmorsy02 ‪@omarmorsy02‬

Пікірлер: 4
@alfykerolous1869
@alfykerolous1869 2 ай бұрын
why would u use a visited arr since it's a tree and ACYCLIC no need for it just check when dfsing :D send ur parent or previous and donot dfs if you u r ur parent
@ahmdelemam
@ahmdelemam 2 ай бұрын
Yes, we explained that at the end, just be patient and keep watching 😃
@alfykerolous1869
@alfykerolous1869 2 ай бұрын
@@ahmdelemam mb😁
@HassanAhmed-kx2yu
@HassanAhmed-kx2yu 3 ай бұрын
A non-recursive (iterative) implementation of pre-order traversal using a stack : ArrayList dfs(ArrayList[] adjList) { ArrayList traversal = new ArrayList(); Set visited = new HashSet(); Stack stack = new Stack(); stack.push(0); visited.add(0); while (!stack.empty()) { var top = stack.pop(); traversal.add(top); for (int i=adjList[top].size() - 1; i >= 0; i--) { if(!visited.contains(adjList[top].get(i))) { stack.push(adjList[top].get(i)); visited.add(adjList[top].get(i)); } } } return traversal; }
3 sum - Three Sum in Arabic - Problem Solving بالعربي
15:34
Ahmed Elemam
Рет қаралды 1,6 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
Spongebob ate Michael Jackson 😱 #meme #spongebob #gmod
00:14
Mr. LoLo
Рет қаралды 10 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,3 МЛН
Graph Theory - Maximum Flow - 2 (Arabic)
25:54
Arabic Competitive Programming
Рет қаралды 6 М.
قصة تجربتي ل 6 شهور اختفاء وتطوير نفسي | مفيدة ول لا ؟
6:11
Overlapping intervals - Problem Solving ‎بالعربي
30:10
Ahmed Elemam
Рет қаралды 1,3 М.
The Blind Date Show 2 - Episode 36 with Hind & Fady
20:17
BingeCircle
Рет қаралды 3,1 МЛН
162. Find Peak Element in Arabic - Problem Solving ‎بالعربي
26:17
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33