# Swift Dictionary 扩容机制 ## Dictionary ```swift let dic = ["d": 4, "a": 1, "b": 2, "c": 3] print(dic) // ["c": 3, "d": 4, "a": 1, "b": 2] ``` Dictionary 顺序会乱序 ## KeyValuePairs KeyValuePairs 顺序不会乱序 ```swift let kvs: KeyValuePairs = ["d": 4, "a": 1, "b": 2, "c": 3] print(kvs) // ["d": 4, "a": 1, "b": 2, "c": 3] ``` 开放寻址法