--- ###### tags: `Program` `Data Structure` --- Data Structure 資料結構 === :::warning **Program = Data Structure + Algorithm** > **[Algorithm](https://)** > 是一種用於處理某件特定事情的方法 > **Data Structure** > 是資料的組織、管理和處理格式,為了能高效存取和修改資料 **資料結構和演算法不分家,有了資料結構,演算法才可以盡情發揮。** ::: ## Information ### 什麼是資料結構(Data Structure)? 資料結構是演算法的基石。 :::info **有幾種基本資料結構組成方式:** 1. **==線性結構(Linear)==** **陣列(array)、鏈結串列(linked list), 以及衍生出的堆疊(stack)、佇列(queue)和雜湊表(hash table)。** 2. **==樹(Tree)==** **二元樹(binary tree),以及衍生出的二元堆(binary heap)等。** 3. **==圖(Graph)==** **是比較複雜的資料結構,因為圖中會有多對多的關聯關係。** **其他資料結構:** 這些是由基本資料結構變形而來,用於解決某些特定問題, 例如: 跳躍列表、雜湊鏈結串列、點陣圖等。 ::: ## Array(陣列) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Linked List(鏈結串列) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Stack(堆疊) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Queue(佇列) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Hash Table(雜湊表) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** ```java Map<K, V> hashTable = new HashMap<>(); ``` <br/> ## Tree(樹) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Binary Heap(二元堆) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Priority Queue(優先佇列) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/> ## Graph(圖) Usage: : how to use **Time Complexity:** **Space Complexity:** **Code** <br/><br/> > [time=Fri, Jan 20, 2023 1:41 AM] > [name=HsingyuChen]
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up