1462. Course Schedule IV | Topological Sort | Kahn's Algorithm

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 10

  • @ARYANMITTAL
    @ARYANMITTAL  3 дні тому +2

    Course Schedule (Famous Problem) - ua-cam.com/video/7bo6lklvpQI/v-deo.html
    But getting this in an Interview, we would be self doubting our most Optimal Solution 🫣

  • @coder6109
    @coder6109 2 дні тому +1

    Hi @aryan why cant we solve this by first forming a map of the toposort array (element,level in the toposort) so if for (a,b) if map.get(a) is less this means this comes first in toposort
    but 1 things is left how will this ensure that a,b are connected or not so can use DSU for that so wont then time complexity by just (n^2) i.e. of toposort and dsu just takes ~ o(1)
    Please suggest am I correct ?

  • @shyamaharihar2425
    @shyamaharihar2425 3 дні тому +1

    Explained well !

  • @VIDITSHRIMALI-l8o
    @VIDITSHRIMALI-l8o 3 дні тому +1

    code quality

  •  3 дні тому +1

    brother where is 3435. Frequencies of Shortest Supersequences

  • @aryamukherjee4122
    @aryamukherjee4122 3 дні тому +1

    Topo sort is fine but dfs also works right given the bound is only 100 ?

  • @vishalbairagi7238
    @vishalbairagi7238 3 дні тому +1

    thanks bhaiya 🙏

  • @subratamandal2924
    @subratamandal2924 2 дні тому

    Bad explanation 😢