예제 #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')
예제 #2
0
def trie() -> Trie:
    return Trie()
예제 #3
0
def test_apple_trie_insert_app_search_app_returns_true(apple_trie: Trie, ):
    apple_trie.insert('app')
    assert apple_trie.search('app')
예제 #4
0
def trie2() -> Trie:
    trie2 = Trie()
    trie2.insert('millennium')
    return trie2
예제 #5
0
def test_apple_trie_startswith_app_returns_true(apple_trie: Trie, ):
    assert apple_trie.startswith('app')
예제 #6
0
def test_apple_trie_search_app_returns_false(apple_trie: Trie, ):
    assert not apple_trie.search('app')
예제 #7
0
def test_apple_trie_search_apple_returns_true(apple_trie: Trie, ):
    assert apple_trie.search('apple')
예제 #8
0
def test_0(trie: Trie, ):
    trie.insert('app')
    assert trie.search('app')
예제 #9
0
def apple_trie(trie: Trie, ) -> Trie:
    trie.insert('apple')
    return trie