You are on page 1of 4

 A data structure is a data organization, management, and storage

format that enables efficient access and modification.


Eg:- ARRAY

Data structure where data elements are arranged


sequentially or linearly and where the elements are
attached to its previous and next adjacent is called a linear
data structure.
In linear data structure, single level is involved.
1 2 3 54 67 89 100
0 1 2 3 4 5 6
Therefore, we can traverse (visit) all the elements in
single run only.
A[4] = 67
A[6] = 100
Linear data structures are easy to implement because
computer memory is arranged in a linear way.
Data structures where data elements are not arranged
sequentially or linearly are called  non-linear data
structures.
In a non-linear data structure, single level is not involved.

Therefore, we can’t traverse (Visit) all the elements in


single run only.

Non-linear data structures are not easy to implement in


comparison to linear data structure.
Advantage:-
It utilizes computer memory efficiently in comparison to a
linear data structure. 
A pointer is a variable whose value is the address of another variable.
Eg - int A=10 //Normal variable
int *B; //Pointer Variable
B= &A; //address of ‘A’

A structure is a user defined data type in C.


A structure creates a data type that can be used to group
items of possibly different data types into a single type. 
 'struct' keyword is used to create a structure. 

How to create a structure


struct struct_name {
DataType member1_name;
DataType member2_name;
DataType member3_name;

};

How to declare variable of a structure?


struct  struct_name  var_name;
or
struct struct_name {
DataType member1_name;
DataType member2_name;
DataType member3_name;

} var_name;

Eg
struct student {
char firstName[50];
int roll;
float marks;
} s1,s2;

Linked List
Like arrays, Linked List is a linear data structure.
Unlike arrays, linked list elements are not stored at a contiguous
location; the elements are linked using pointers.

Each node in a list consists of at least two parts:


1) data
2) Pointer (Or Reference) to the next node

You might also like