Sha256: 873e480824fc6d887bf8aa493f985a3e30e5e14af73f3ab1694805fb406cba52

Contents?: true

Size: 380 Bytes

Versions: 42

Compression:

Stored size: 380 Bytes

Contents

require "tsort"

# @type var g: Hash[Integer, Array[Integer]]
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}

# @type var each_node: ^() { (Integer) -> void } -> void
each_node = -> (&b) { g.each_key(&b) }
# @type var each_child: ^(Integer) { (Integer) -> void } -> void
each_child = -> (n, &b) { g[n].each(&b) }

# @type var xs: Array[Integer]
xs = TSort.tsort(each_node, each_child)

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
steep-1.3.1 smoke/tsort/a.rb
steep-1.4.0.dev.2 smoke/tsort/a.rb
steep-1.4.0.dev.1 smoke/tsort/a.rb
steep-1.3.0 smoke/tsort/a.rb
steep-1.3.0.pre.2 smoke/tsort/a.rb
steep-1.3.0.pre.1 smoke/tsort/a.rb
steep-1.2.1 smoke/tsort/a.rb
steep-1.2.0 smoke/tsort/a.rb
steep-1.2.0.pre.1 smoke/tsort/a.rb
steep-1.1.1 smoke/tsort/a.rb
steep-1.1.0 smoke/tsort/a.rb
steep-1.1.0.pre.1 smoke/tsort/a.rb
steep-1.0.2 smoke/tsort/a.rb
steep-1.0.1 smoke/tsort/a.rb
steep-1.0.0 smoke/tsort/a.rb
steep-0.52.2 smoke/tsort/a.rb
steep-0.52.1 smoke/tsort/a.rb
steep-0.52.0 smoke/tsort/a.rb
steep-0.51.0 smoke/tsort/a.rb
steep-0.50.0 smoke/tsort/a.rb