编程语言中的数据结构详解---Here is the extracted content from the image: **1. Array** * **Type:** Linear data structure (Array) * **Main Elements:** * **Nodes/Elements:** Five blue rectangular cells arranged horizontally. * **Content:** The cells contain numerical values: 6, 3, 8, 12, 11. * **Indexing:** Below each cell, there is an index number: 0, 1, 2, 3, 4, corresponding to the element above it. **2. Queue** * **Type:** Linear data structure (Queue) * **Main Elements:** * **Nodes/Elements:** Three blue rectangular cells arranged horizontally. * **Content:** The cells contain numerical values: 6, 3, 8. * **Direction/Labels:** * An arrow labeled "rear" points from left to right, indicating the insertion end. * An arrow labeled "front" points from right to left, indicating the removal end. **3. Matrix** * **Type:** 2D data structure (Matrix) * **Main Elements:** * **Grid:** A 5x5 grid composed of 25 empty blue square cells. * **Indexing:** * Column indices: 0, 1, 2, 3, 4 are labeled horizontally above the grid. * Row indices: 0, 1, 2, 3, 4 are labeled vertically along the left side of the grid. **4. Stack** * **Type:** Linear data structure (Stack) * **Main Elements:** * **Nodes/Elements:** Five blue rectangular cells stacked vertically. * **Operations/Labels:** * "push": A curved arrow points downwards into the top of the stack from the left. * "pop": A curved arrow points upwards and out from the top of the stack to the right. * "top": A label indicating the top of the stack. **5. Tree** * **Type:** Hierarchical data structure (Tree) * **Main Elements:** * **Nodes:** Seven blue circular nodes. * **Connections:** Lines connect nodes in a hierarchical manner. * **Label:** The topmost node is labeled "root". The tree has a root node, two children, and then each of those children has two children, forming three levels. **6. Linked List** * **Type:** Linear data structure (Linked List) * **Main Elements:** * **Nodes/Elements:** Five blue rectangular cells (nodes) arranged horizontally. * **Content:** The cells contain numerical values: 6, 3, 8, 12, 11. * **Connections:** Right-pointing arrows connect each node to the next in sequence. * **Labels:** * "head" points to the first node (6). * "tail" points to the last node (11). * **Annotation:** "@visualcoders" is displayed below the linked list diagram. **7. HashMap** * **Type:** Associative array (HashMap) * **Main Elements:** * **Keys:** Three blue rectangular cells labeled K1, K2, K3 on the left. * **Hash Function:** A central element labeled "h(k)". * **Values/Buckets:** On the right, a vertical list of indices (0, 1, 2, 3) representing buckets. * **Connections:** * Dashed lines connect K1, K2, K3 to "h(k)". * Dashed lines connect "h(k)" to indices 0, 1, 2, 3. * Small blue rectangles containing values V2, V1, V3 are associated with specific indices: V2 with 0, V1 with 1, V3 with 3. Index 2 appears empty. **8. BST (Binary Search Tree)** * **Type:** Hierarchical data structure (Binary Search Tree) * **Main Elements:** * **Nodes:** Seven blue circular nodes. * **Content:** Nodes contain numerical values: 4 (root), 2, 6, 1, 3, 5, 7. * **Connections:** Lines connect parent nodes to their child nodes, showing a binary tree structure. * **Structure:** Node 4 is the root. Its left child is 2, and its right child is 6. Node 2 has left child 1 and right child 3. Node 6 has left child 5 and right child 7. The values respect the BST property (left child < parent < right child). **9. Heap** * **Type:** Hierarchical data structure (Heap) * **Main Elements:** * **Nodes:** Six blue circular nodes with numerical values, and one additional circular node that is empty/unlabeled in the diagram. * **Content:** Nodes contain numerical values: 9 (root), 5, 8, 2, 3, 6. * **Connections:** Lines connect parent nodes to their child nodes, forming a complete binary tree structure up to the last level. * **Structure:** Node 9 is the root. Its left child is 5, and its right child is 8. Node 5 has left child 2 and right child 3. Node 8 has left child 6. (The diagram illustrates a max-heap where parent values are greater than or equal to child values). **10. Trie** * **Type:** Tree-like data structure (Trie / Prefix Tree) * **Main Elements:** * **Nodes:** Blue circular nodes, including a root node and subsequent nodes. * **Connections/Labels:** Lines connect nodes, and characters (c, a, n, p, t, e, n, t, s, e) are labeled along these connecting lines, representing path segments (e.g., characters of a word). * **Structure:** Represents a set of strings, where common prefixes share the same path from the root. **11. Graph** * **Type:** Non-linear data structure (Directed Graph) * **Main Elements:** * **Nodes:** Six blue circular nodes. * **Connections:** Lines with arrows (directed edges) connect nodes, indicating relationships with a specific direction. * **Structure:** Shows a general directed graph with various nodes and directed connections between them. **12. Union Find** * **Type:** Data structure for maintaining disjoint sets (Union Find) * **Main Elements:** * **Nodes:** Four blue circular nodes. * **Connections:** Three lines connect the nodes: * Top-left node is connected to the bottom-left node. * Bottom-left node is connected to the bottom-right node. * Top-right node is connected to the bottom-right node. * **Structure:** The diagram illustrates a single connected component of four nodes, forming a shape resembling a 'U' with an additional vertical segment on its right arm.

视频信息