正在加载图片...
Direct-access table IDEA: Suppose that the set of keys is K C 10 m-1), and keys are distinct. Set up an array 110.. m-1 7k]= xifk∈ K and keylx]=k, nil otherwise Then, operations take o()time Problem: The range of keys can be large 64-bit numbers(which represent 182446,74073,709,551616 different keys), character strings(even larger o 2001 by Charles E Leiserson Introduction to Algorithms Day 11 L7.3© 2001 by Charles E. Leiserson Introduction to Algorithms Day 11 L7.3 Direct-access table IDEA: Suppose that the set of keys is K ⊆ {0, 1, …, m–1}, and keys are distinct. Set up an array T[0 . . m–1]: T[k] = x if k ∈ K and key[x] = k, NIL otherwise. Then, operations take Θ(1) time. Problem: The range of keys can be large: • 64-bit numbers (which represent 18,446,744,073,709,551,616 different keys), • character strings (even larger!)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有