0% found this document useful (0 votes)
65 views

A Data Structure Is A Data Organization, Management, and Storage Format That Enables Access and Modification. Eg:-Array

A data structure is a format for organizing and storing data that allows for efficient access and modification. Linear data structures arrange elements sequentially, allowing them to be traversed in a single pass, while non-linear structures do not arrange elements sequentially and cannot be traversed in a single pass. Common data structures include arrays, linked lists, stacks, queues, trees, and graphs.

Uploaded by

Riyaz Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

A Data Structure Is A Data Organization, Management, and Storage Format That Enables Access and Modification. Eg:-Array

A data structure is a format for organizing and storing data that allows for efficient access and modification. Linear data structures arrange elements sequentially, allowing them to be traversed in a single pass, while non-linear structures do not arrange elements sequentially and cannot be traversed in a single pass. Common data structures include arrays, linked lists, stacks, queues, trees, and graphs.

Uploaded by

Riyaz Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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