Topological sort using bfs or dfs

can you explain topological sort to me? I am not getting its idea

@meg.2198 there is a video for both of these two in course content i will recommend to go through.