
Redirected from
github.com/osspkg/go-algorithms.
module
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Nov 13, 2019
License: GPL-3.0
Opens a new window with license information.
README
¶
Algorithms
Algorithmic calculation methods
1) Topological sorting. Kahn's Algorithm.
import (
graphkahn "https://github.com/deweppro/algorithms/graph/kahn"
)
kahn := graphkahn.New()
kahn.Add("1", "2")
kahn.Add("1", "3")
kahn.Add("3", "4")
kahn.Add("2", "4")
kahn.Add("4", "5")
kahn.Build()
result := kahn.Result()
Result: [1,2,3,4,5]
Directories
¶
graph
|
|
kahn
see: https://en.wikipedia.org/wiki/Topological_sorting
|
see: https://en.wikipedia.org/wiki/Topological_sorting |
Click to show internal directories.
Click to hide internal directories.