Data structures are ways of organising data in a system. It improves the efficiency of data management. Data structures can be categorised into two types. They are:
- Linear data structure
- Non-linear data structure
Linear data structure: The elements of a linear data structure are arranged one after the other. Linear data structures are easy to implement because the elements are arranged in a specific order.
Non-linear data structures: Unlike linear data structures, the elements of non-linear data structures have no order. They are arranged hierarchically.
There are many kinds of data structures. Common data structures include stacks, binary trees, binary search trees, and AVL trees. Data structures are an important topic related to computer science engineering and an important topic for exams such as GATE. Therefore, GATE candidates should know all aspects of what is data structure.
The structure of data and the synthesis of algorithms are interrelated. The presentation of data should be easy to understand so that both developers and users can implement operations efficiently. Data structures provide an easy way to organise, access, manage, and store data.
Why Are Data Structures Needed?
- Modification of data structures is easy.
- It requires a shorter period of time.
- Memory space can be saved.
- Data can be represented in an easier way.
- Large databases can be accessed conveniently.
Linked List Data Structure
A linked list is a linear collection of data elements that are not ordered by their physical placement in memory. A linked list is a data structure consisting of a collection of nodes representing sequences.
It is an important subject that belongs to the chapter on data structures in Computer Science Engineering. Additionally, aspirants for GATE or other competitive exams for computer science are required to study extensively across this topic. A linked list is a linear collection of data items that are not ordered by their physical placement in memory. Instead, the element points are consecutive in the linked list. This is a data structure consisting of a collection of nodes representing sequences.
Types of Linked Lists
Different types of linked lists are mentioned below:
- Singly Linked List: Linked lists of this type are the easiest to manage since each node contains some data and a pointer to the next one. We can perform operations like insertion, deletion, and traversal in a singly linked list.
- Doubly Linked List: In a doubly-linked list, a data part and two addresses are held by a node.
- Circular Linked List: A circular linked list is formed by the last node of the series containing the address of the first node.
Advantages of Linked Lists
- Since linked lists are dynamic, they provide memory whenever needed.
- In a linked list, operations like insertion and deletion can be performed swiftly.
- Stacks and queues can be implemented quickly.
- Access time can be reduced using it.
Disadvantages of Linked Lists
- Because pointers require extra memory for storage, sometimes the memory gets wasted.
- It is possible to access elements in a sequence. Performing this process at random is not possible.
- Reverse traversing is difficult in a linked list.