Created
July 17, 2018 21:50
-
-
Save deepakraous/697120cc196c2ced8e2d0b66be09ee3d to your computer and use it in GitHub Desktop.
Skeleton implementation of basic trie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@trie_map %{96781234 => ["/", [0], [-99999] ] } | |
@characters "" | |
def add(trie \\@trie_map, items) do | |
splitter = split(trie,items) | |
end | |
def split(trie,items) do | |
splitted_items = items |>String.split( "", trim: true) | |
|>Enum.map( fn(item)-> | |
key = gen_unique_id | |
add_to_trie(trie, item) | |
end ) | |
# final_item = add_relation(splitted_items, items) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment