Skip to content

Data Structure

数据结构可以分为 「逻辑结构」「物理结构」

  • 逻辑结构可分为:集合结构线性结构树形结构图形结构
  • 物理结构可分为:顺序存储结构链式存储结构

「逻辑结构」指的是数据之间的 关系,「物理结构」指的是这种关系 在计算机中的表现形式

例如:线性表中的「栈」,其数据元素之间的关系是一对一的,除头和尾结点之外的每个结点都有唯一的前驱和唯一的后继,这体现的是逻辑结构。而对于栈中的结点来说,可以使用顺序存储(也就是 顺序栈)的方式存储在计算机中,其结构在计算机中的表现形式就是一段连续的存储空间,栈中每个结点和它的前驱结点、后继结点在物理上都是相邻的。当然,栈中的结点也可以使用链式存储(也即是 链式栈),每个结点和它的前驱结点、后继结点在物理上不一定相邻,每个结点是靠前驱结点的指针域来进行访问的。

Array

String

Hash Table

Stack

Queue

Linked List

Tree

Graph

Basic Data Structures

  • Array
  • Linked List
  • Singly Linked List
  • Doubly Linked List
  • Circular Linked List
  • Stack
  • Queue
  • Simple Queue
  • Deque (Double-Ended Queue)
  • Circular Queue
  • Priority Queue

Tree Data Structures

  • Binary Tree
  • Full Binary Tree
  • Complete Binary Tree
  • Balanced Binary Tree
  • Binary Search Tree (BST)
  • Balanced Trees
  • AVL Tree
  • Red-Black Tree
  • Splay Tree
  • Multi-way Tree
  • B-Tree
  • B+ Tree
  • B* Tree
  • 2-3 Tree
  • 2-3-4 Tree
  • R-Tree
  • Trie (Prefix Tree)
  • Suffix Tree
  • Segment Tree
  • Fenwick Tree (or Binary Indexed Tree, BIT)
  • Heap
  • Min Heap
  • Max Heap
  • Binomial Heap
  • Fibonacci Heap
  • Pairing Heap
  • Leftist Heap
  • Skew Heap

Graph Data Structures

  • Graph
  • Directed Graph
  • Undirected Graph
  • Weighted Graph
  • Unweighted Graph
  • Dense Graph
  • Sparse Graph
  • Adjacency Matrix
  • Adjacency List
  • Edge List
  • Other Graph Representations (e.g., Incidence List, Cross List, etc.)

Hashing and Set Data Structures

  • Hash Table
  • Hash Set
  • Bloom Filter
  • Skip List
  • Dictionary
  • Cuckoo Hashing

Advanced and Special-Purpose Data Structures

  • Union-Find (or Disjoint Set)
  • Skip List
  • Topological Sort
  • Deque (Double-Ended Queue)
  • Priority Queue
  • Topological Heap
  • Least Recently Used (LRU) Cache
  • Persistent Data Structures
  • Self-Adjusting Data Structures (e.g., Splay Tree)

Geometric Data Structures

  • Interval Tree
  • kd-Tree
  • Quadtree
  • Octree
  • R-Tree
  • Convex Hull
  • Range Tree

Special and Composite Data Structures

  • Multi-Level Indexing
  • Chained Hashing
  • Open Addressing
  • Grid
  • Topological Sort
  • Linked Matrix