Catatan: Terjemahan untuk entri ini sedang dalam peninjauan kualitas, sehingga sebagian konten untuk sementara hanya ditampilkan dalam bahasa Inggris.
Entri ini belum diterjemahkan ke bahasa Anda, sehingga versi aslinya ditampilkan di bawah.
adjacency list
This term is a technical specification within graph theory and computer science. It describes a memory-efficient way to store a graph, particularly when the graph is sparse, meaning most possible connections between nodes do not exist. It is typically contrasted with an adjacency matrix, which uses a two-dimensional array and consumes more space regardless of the number of edges.
In practical implementation, an adjacency list is often realized as an array of linked lists or dynamic arrays. Because it only stores existing edges, it allows for faster iteration over the neighbors of a specific vertex, making it the preferred choice for algorithms like Breadth-First Search (BFS) and Depth-First Search (DFS).