Skip to content

Trie contradicts its documentation #940

@bvdmitri

Description

@bvdmitri

In the documentation you can read the following

"Note that the keys don't need to be Strings:"
with the following example

julia> t = Trie{Int,Char}();

julia> t[1:3] = 'a';

julia> t[[2,3,5]] = 'b';

julia> keys(t)
2-element Vector{Vector{Int64}}:
 [2, 3, 5]
 [1, 2, 3]

however on [864edb3b] DataStructures v0.18.22 I get

julia> t = Trie{Int,Char}();
ERROR: too many parameters for type Trie
Stacktrace:
 [1] top-level scope
   @ REPL[8]:1

There is also no built-in documentation for Trie

help?> Trie
search: Trie write RBTree Type stride

  No documentation found for public symbol.

  Summary
  ≡≡≡≡≡≡≡

  mutable struct Trie{T}

  Fields
  ≡≡≡≡≡≡

  value    :: T
  children :: Dict{Char, Trie{T}}
  is_key   :: Bool

and the children :: Dict{Char, Trie{T}} line suggest that keys indeed need to be Strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions