Data Structure

Data Structures: A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. Below is an overview of some popular linear data structures. 1. Array 2. Linked List 3. Stack 4. Queue Array The array is a data structure used to store homogeneous elements at contiguous locations. The size of an array must be provided before storing data. Example: For example, let us say, we want to store marks of all students in a class, we can use an array to store them. This helps in reducing the use of a number of variables as we don’t need to create a separate variable for marks of every subject. All marks can be accessed by simply traversing the array. Linked List A linked list is a linear data structure (like arrays) where each element is a separate object. Each element (that is node) of a list is comprised of two items – the data and a reference to th...