Example #1
0
def test_trie2_insert(trie2: Trie, ):
    assert trie2.search('millennium')
    assert not trie2.search('mill')
    assert trie2.startswith('mill')
    trie2.insert('mill')
    assert trie2.search('mill')
    assert not trie2.search('newspaper')
Example #2
0
def trie() -> Trie:
    return Trie()
Example #3
0
def test_apple_trie_insert_app_search_app_returns_true(apple_trie: Trie, ):
    apple_trie.insert('app')
    assert apple_trie.search('app')
Example #4
0
def trie2() -> Trie:
    trie2 = Trie()
    trie2.insert('millennium')
    return trie2
Example #5
0
def test_apple_trie_startswith_app_returns_true(apple_trie: Trie, ):
    assert apple_trie.startswith('app')
Example #6
0
def test_apple_trie_search_app_returns_false(apple_trie: Trie, ):
    assert not apple_trie.search('app')
Example #7
0
def test_apple_trie_search_apple_returns_true(apple_trie: Trie, ):
    assert apple_trie.search('apple')
Example #8
0
def test_0(trie: Trie, ):
    trie.insert('app')
    assert trie.search('app')
Example #9
0
def apple_trie(trie: Trie, ) -> Trie:
    trie.insert('apple')
    return trie