# What Is Link List in Data Structure in English?

//

Heather Bennett

A link list is an important data structure in computer science. It is also known as a linked list. In this article, we will discuss what a link list is and how it works.

A link list is a linear data structure that consists of a sequence of nodes. Each node contains two parts: data and a pointer to the next node in the sequence. The first node is called the head node, and the last node has a pointer that points to null, indicating the end of the list.

There are different types of link lists, including:

• Singly Linked List: In this type of link list, each node has only one pointer that points to the next node.
• Doubly Linked List: In this type of link list, each node has two pointers – one that points to the previous node and one that points to the next node.
• Circular Linked List: In this type of link list, the last node’s pointer points back to the first node, forming a circular structure.

• Link lists are dynamic in nature, which means they can grow or shrink during program execution.
• Insertion and deletion operations can be performed efficiently in link lists compared to arrays or other data structures.
• Link lists provide flexibility in memory allocation as they do not require contiguous memory locations.

To add a new node at the beginning of a singly linked list:
```<pre> struct Node { int data; struct Node* next; };```

``` ```

```void insertAtBeginning(struct Node** head_ref, int new_data) { struct Node* new_node = (struct Node*)malloc(sizeof(struct Node)); new_node->data = new_data; new_node->next = (*head_ref); (*head_ref) = new_node; } </pre>```

```<pre> void printList(struct Node* node) { while (node != NULL) { printf("%d ", node->data); node = node->next; } } </pre>```