WeBeginners-Community / DocBook

Documentations of Html to every open source technologies. It's a low-code repository
30 stars 54 forks source link

Title:Toplogical sort #115

Closed diyagoyal98 closed 1 year ago

diyagoyal98 commented 1 year ago

Is your feature request related to a problem? Please describe.

Topological sort ->It is for Directed Acyclic Graph (DAG) it is a linear ordering of the vertices such that if their is an edge u->v ,then u appears before v in that ordering .

Describe the solution you'd like.

I can perform topological sort by modifying dfs algorithm.

Describe alternatives you've considered.

Toplogical sorting can also be performed byusing kahn's Algorithm.

Add any other context or screenshots about the feature request here.

graph_example

Example -> Consider the above image so it's one of the possible topological sort will be 5 4 2 3 1

I can perform these both approach in C++. Please assign this task to me.