2 Dec 2019

  • December 02, 2019
  • Amitraj
Adjacency List

1. Adjacency list is another representation of graphs.
2. It is a collection of unordered list, used to represent a finite graphs.
3. Each list describes the set of neighbors of a vertex in the graph.
4. Adjacency list requires less amount of memory.
5. For every vertex, adjacency list stores a list of vertices, which are adjacent to the current one.
6. In adjacency list, an array of linked list is used. Size of the array is equal to the number of vertices.




7. In adjacency list, an entry array[i] represents the linked list of vertices adjacent to the ith vertex.

8. Adjacency list allows to store the graph in more compact form than adjacency matrix.

9. It allows to get the list of adjacent vertices in O(1) time.



Disadvantages of Adjacency List

-> It is not easy for adding or removing an edge to/from adjacent list.

-> It does not allow to make an efficient implementation, if dynamically change of vertices number is required.


NOTE:

Vertex: Each node of the graph is represented as a vertex.

Edge: It represents a path between two vertices or a line between two vertices.

Path: It represents a sequence of edges between the two vertices.

Adjacency: If two nodes or vertices are connected to each other through an edge, it is said to be an adjacency

Related Posts:

  • Tree Traversal Techniques Tree Traversal -> Tree Traversal refers to the process of visiting each node in a tree data structure exactly once. -> Different tree traversal techniques are:- 1. Depth first Traversal -  there are 3 te… Read More
  • Doubly Linked List Data Structure  Doubly Linked List Data Structure -> Doubly Linked List is a variation of Linked list in which navigation is possible in both ways, either forward and backward easily as compared to Single Linked List.  -&g… Read More
  • infix to post fix (Reverse polish notation) expression Infix Expression It follows the scheme of <operand><operator><operand> i.e. an <operator> is preceded and succeeded by an <operand>. Such an expression is termed infix expression. E… Read More
  • Tree (data Structure) | Tree Terminology Tree (data Structure) -> In linear data structure data is organized in sequential order and in non-linear data structure data is organized in Random order. -> A tree is a very popular non-linear data structure used i… Read More
  • Difference between Array and Linked List Difference between Array and Linked List -> Both Linked List and Array are used to store linear data of similar type, but an array consumes contiguous memory locations allocated at compile time, i.e. at the time of decl… Read More

Translate

Popular Posts