Тёмный
No video :(

10. Most people do this by DFS only | BFS DFS-C++,JAVA | LeetCode 547-No of Provinces with Intuition 

Keerti Purswani
Подписаться 139 тыс.
Просмотров 2,4 тыс.
50% 1

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

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 16   
@sharatpaul
@sharatpaul 6 месяцев назад
Please use white pen instead of red since the background is black
@sudiptosaha7467
@sudiptosaha7467 4 месяца назад
Can be done using BFS. I tried this way - int NumProvinces(vector & adjMat) { q.push(0); for (int j = 0; j < numNodes; j++) { if (!visited[j]) { while (!q.empty()) { int curr = q.front(); q.pop(); for (int i = 0; i < numNodes; i++) { if (adjMat[curr][i] && !visited[i]) { q.push(i); visited[i] = true; } } } numProvince++; } } return numProvince; }
@surajprakashsinghh
@surajprakashsinghh 2 месяца назад
isme naya kaya hai
@harshav4704
@harshav4704 7 месяцев назад
Mam this is really a good and simple one and i was able to do following your dfs lecture logic. Thanks keerti mam.😀👍🏻
@dayashankarlakhotia4943
@dayashankarlakhotia4943 7 месяцев назад
Good explanation 👏 🎉
@Raj10185
@Raj10185 6 месяцев назад
Awsome video mam, I finally did the bfs code for this problem
@rajendiranvenkat5992
@rajendiranvenkat5992 7 месяцев назад
Thank god. Video came.
@bluebirdclub092
@bluebirdclub092 6 месяцев назад
thnx 😇
@Aarya985
@Aarya985 7 месяцев назад
Thanks ma'am
@nithiin7
@nithiin7 7 месяцев назад
Teach us problems which are application of graph that can't be identified on first sight that is an application of graph
@KeertiPurswani
@KeertiPurswani 7 месяцев назад
Yup! Will teach everything! Be patient! Hope you watched the last video! That was one such question!
@amanverma8097
@amanverma8097 22 дня назад
for me light mode was better
@shwetabansal2202
@shwetabansal2202 7 месяцев назад
Do you have any upcoming series on string/trie related questions ?
@avinashtiwari4025
@avinashtiwari4025 2 месяца назад
is time complexity of dfs is o(n2)?
@surajprakashsinghh
@surajprakashsinghh 2 месяца назад
yes, O(n^2)
Далее
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Просмотров 4,5 млн
Hello Developers | Live
Просмотров 157