Trie


  • 樹的data structure,用在字串的檢索

  • 複雜度:
    m:字串的長度
    n:字串的數量
    **1.Binary Search
    -->Time complexity :

        Construct complexity : O\(m\*n\*logn\)  
        Search complexity : O\(m\*logn\)  
    

    -->Space complexity:

        O\(m\*n\)  
    

    2.Trie:O(m)
    -->Time complexity :

        Construct complexity : O\(m\*n\)  
        Search complexity : O\(m\)**
    

    **-->Space complexity:

        O\(m\*n\)**
    

results matching ""

    No results matching ""