Maharashtra State Board of Technical Education, Mumbai: A Micro Project On
Maharashtra State Board of Technical Education, Mumbai: A Micro Project On
MUMBAI
A micro project
On
”OPERATION ON ARRAY”
DIPLOMA
In
Computer Engineering
Submitted by
MS. PALLAVI KASHINATH KORE
UNDER GUIDANCE OF
CERTIFICATE
This is to that the following students of third Semester of Diploma in Computer
Engineering of Institute SANT GAJANAN MAHARAJ RURAL POLYTECHNIC,
MAHAGAON-416503. (CODE-0965) has completed Micro project “OPERATION ON
ARRAY” in subject “Data Structure Using C” subject code: -22317 of during the
academic year 2023to 2024.
Roll
Student name Enrollment no
No.
INDEX
Sr. No Title Page No
0.4 Introduction 1
0.5 3
Actual Procedure Followed
0.6 3
Resources Required
0.9 Conclusion 7
10 References 7
1.0 Ratitonale
The data structure is an important aspect for Computer Engineering and Information
Technology Diploma graduates. The data structure is a logical & mathematical model of
storing & organizing data in a particular way in a computer. The methods and techniques of
Data Structures are widely used in industries. After learning these subject students will be
able to identify the problem, analyse different algorithms to solve the problem & choose the
most appropriate data structure to represent the data.
An array is a data structure for storing more than one data item that has a similar data type.
The items of an array are allocated at adjacent memory locations. These memory locations
are called elements of that array. The total number of elements in an array is called length.
The basic operations in the Arrays are insertion, deletion, searching, display, traverse, and
update. These operations are usually performed to either modify the data in the array or to
report the status of the array.
4 Implementation and
execution of programs
5 Arranging project
sequentially
6 Submission of michro
project
1.0Ratitonale
The data structure is an important aspect for Computer Engineering and Information
Technology Diploma graduates. The data structure is a logical & mathematical model of
storing & organizing data in a particular way in a computer. The methods and techniques of
Data Structures are widely used in industries. After learning these subject students will be
able to identify the problem, analyse different algorithms to solve the problem & choose the
most appropriate data structure to represent the data.
An array is a data structure for storing more than one data item that has a
similar data type. The items of an array are allocated at adjacent memory locations.
These memory locations are called elements of that array. The total number of
elements in an array is called length.
Operations on Array
OPERATIONS ON ARRAY
1. Traversing
2. Inserting
3. Searching
4. Deletion
5. Updation
1.Traversing
Algorithm
Step 1:Start
Program
#include<stdio.h>
#include<conio.h>
void main()
int arr[5]={1,2,3,4,5},i;
clrscr();
for(i=0;i<5;i++)
printf("\narr[%d]=%d",i,arr[i]);
getch();
Output:-
Program
#include<stdio.h>
#include<conio.h>
void main()
clrscr();
pos=2;
for(i=0;i<n;i++)
{printf("\n%d",arr[i]);
for(i=n-1;i<=n;i++)
{arr[pos-1]=x;
for(i=0;i<n;i++)
{printf("\n%d",arr[i]);
}getch();}
Output:-
Program
#include<stdio.h>
#include<conio.h>
# define max 5
int queue[max], front=-1, rear=-1;
void enqueue ();
void dequeue ();
void display ();
int main ()
{
int ch;
clrscr ();
printf ("\n **** queue menu ****");
printf ("\n 1. insertion \n 2. deletion\n 3. display\n 4. exit");
while (1)
{
printf ("\n enter the choice (1 to 4)");
scanf ("%d", &ch);
switch(ch)
{
case 1: enqueue ();
break;
case 2: dequeue ();
break;
case 3: display ();
break;
case 4: exit (0);
default: printf ("\n wrong choice!!");
}
}
return 0;
}
void enqueue ()
{
if(rear==max-1)
printf ("\n queue is full!!");
else
{
if (front ==-1)
front=0;
rear++;
printf ("\n enter element to insert:");
scanf ("%d", &queue[rear]);
}
}
void dequeue ()
{
if(front==-1)
printf ("\n queue is empty!!");
else
{
Printf ("\n delete element is %d", queue[front]);
front++;
if(front>rear)
front=rear=-1;
}
}
void display ()
{
int i;
if(rear==-1)
printf ("\n queue is empty!!");
else
{
Printf ("\n ----- element in queue -----\n");
For (i=front; i< =rear; i++)
printf ("%d”, queue [i]);
}
}
Output
0.9 Conclusion
we have comprehended the concept of queue data structure and its
implementation utilizing Arrays in C.
10. References