Sha256: 474ed1a3d54ae870e4764fc8ce60c0e990210ae2043e607213569a7f450fb82a

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

module Rambling
  module Trie
    # Provides the compressible behavior for the trie data structure.
    module Compressible
      # Indicates if the current {Rambling::Trie::Nodes::Node Node} can be compressed
      # or not.
      # @return [Boolean] `true` for non-{Nodes::Node#terminal? terminal} nodes with
      #   one child, `false` otherwise.
      def compressible?
        !(root? || terminal?) && children_tree.size == 1
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rambling-trie-1.0.3 lib/rambling/trie/compressible.rb