0% found this document useful (0 votes)
6 views33 pages

Data Structures Lab BCS-351 Overview

The document outlines the vision and mission of IMS Engineering College's Computer Science and Engineering Department, emphasizing academic excellence, ethical values, and industry interaction. It details the Program Educational Objectives (PEOs) and Program Specific Outcomes (PSOs) for the B.Tech Computer Science program, along with the course outcomes for the Data Structures Lab (BCS-351). Additionally, it provides a syllabus and list of experiments to be conducted in the lab, including various sorting and searching algorithms.

Uploaded by

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

Data Structures Lab BCS-351 Overview

The document outlines the vision and mission of IMS Engineering College's Computer Science and Engineering Department, emphasizing academic excellence, ethical values, and industry interaction. It details the Program Educational Objectives (PEOs) and Program Specific Outcomes (PSOs) for the B.Tech Computer Science program, along with the course outcomes for the Data Structures Lab (BCS-351). Additionally, it provides a syllabus and list of experiments to be conducted in the lab, including various sorting and searching algorithms.

Uploaded by

hp474114
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IMS ENGINEERINGCOLLEGE

Data Structures Lab


(BCS-351)
B. TECH– II YEAR
(ODD SEM2025-2026)
Name HIMANSHU PATEL
Roll No. 2401430100109
CSE 3/2024-28
Section-Batch
DEPARTMENT OF COMPUTERSCIENCE&ENGINEERING
IMS ENGINEERINGCOLLEGE
(AffiliatedtoDrAPJ AbdulKalam Technical University, Lucknow )
Approved by AICTE - Accredited by NAAC – ‘A’
GradeNH#24, AdhyatmikNagar, Ghaziabad, UP, India
[Link]
Visionand Mission oftheInstitute and Department
Vision oftheInstitute
To make IMSEC an Institution of Excellence for empowering students through technical
education coupled with incorporating values and developing engineering acumen for
innovations and leadership skills for the betterment of society.
MissionoftheInstitute
Mission 1: To promote academic excellence by continuous learning in core and emerging
Engineering areas usinginnovative teaching and learning methodologies.
Mission 2: To inculcate values and ethicsamong the learners.
Mission 3: To promote industry interactions and produce young entrepreneurs.
Mission 4: To create a conducive learning and researchenvironment for life-long learning to
develop the students as technology leaders and entrepreneurs for addressing societal
needs.
VisionoftheDepartment
To provide globally competent professionals in the field of Computer Science&Engineering
embedded with sound technical knowledge, aptitude for research and innovation, and
nurture future leaderswithethical values to cater to the industrial&societal needs.
MissionoftheDepartment
Mission 1: To provide quality education in both the theoretical and applied foundations of
Computer Science&Engineering.
Mission 2: Conduct research in Computer Science & Engineering resulting in innovations
therebynurturing entrepreneurial thinking.
Mission 3: To inculcate team building skills and promote life-long learning with highsocietal
and ethical values.
CSEDepartmentProgramEducational Objectives(PEOs)
B. Tech Computer Science&Engineering Department has the following Program
Educational Objectives:
PEO1: Possess core theoretical and practical knowledge in Computer Science and
Engineering for successful career development in industry, pursuing higher studies or
entrepreneurship.
PEO2: Ability to imbibe life-long learning for global challenges to impact society and
environment.
PEO3: To demonstrate work productivity with leadership and managerial skills having
ethics and human value in progressive careerpath.
PEO4: To exhibit communication skill and collaborative skill plan and participate in
multidisciplinaryfields of ComputerScience & Engineering.

CSEDepartment ProgramSpecific Outcomes(PSOs)


[Link] Computer Science&Engineering Department has the following Program Specific
Outcomes:
PSO1: To analyze and demonstrate, the recent engineering practices, ethical values and
strategies inreal time world problemsto meet the challengesfor the future.
PSO2: To develop adaptive computing system using computational intelligence
strategies and algorithmic design to address diverse challenges in data analysis and
machine learning.
PROGRAM OUTCOMES
Engineering Graduateswill be able to:
1. Engineering knowledge: Applythe knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex
engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, naturalsciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified
needs with appropriate consideration for the public health and safety, and the
cultural, societal, andenvironmentalconsiderations.
4. Conduct investigations of complex problems: Use research-based knowledge and
researchmethods including design of experiments, analysis and interpretation of
data, and synthesis ofthe informationto provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources,
and modern engineering and IT tools including prediction and modelling to complex
engineering activities withanunderstanding ofthe limitations.
6. The engineerandsociety: Apply reasoning informed bythe contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professionalengineering practice.
7. Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities andnormsofthe engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader indiverse teams, and inmultidisciplinarysettings.
[Link]: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as, being able to
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of
the engineering and management principles and apply these to one’ s own work,
as a member and leader in a team, to manage projects and in multidisciplinary
environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to
engageinindependent and life-long learning in the broadest contextoftechnological
change.
DETAILS OF THE EXPERIMENTS CONDUCTED
INDEX
[Link] TITLE OF THE EXPERIMENT DATE OF FACULTY
SUBMISSION SIGNATURE
1
2
3
4
5

10

11
12

13

14

15

16
IMS Engineering College
NH-09, Adhyatmik Nagar, NearDasna, Distt. Ghaziabad, U.P.
Department of Computer Science and Engineering
CourseName:Data Structures usingC Lab CourseCode: BCS-351
Semester/ Year: 3rd/ 2nd NBACode: C206
Subject Lab Coordinator:Ms. Sonia Sharma
Associated Faculty name: Mr. Amit Maan,Dr. N UKhan, Mr. Nishant Anand, Ms. Seema,
Ms. Ankita, Mr. Aditya Batra

COURSEOUTCOMES Bloom’s
Level
Implement and analyze vario us searching and sorting alg orithms using K1
C206.1 recursive and non-recursive techniques.
K2
C206.2 Implement basic datastructures suchas array and linked list.
K3
C206.3 Implement the both array-based andlinked-list based Stackand Queue
data structuresand its operations.
C206.4 Implement general tree datastructures, includingbinary tree and binary K4
search trees using linked lists.
C206.5 Identify, model, solve and developcode for real life problems like shortest K5
path and MSTusinggraphtheory.

Course
Outcome PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
s
C206.1 3 3 3 2 1 1 - - 1 - 1 2 3 3
C206.2 3 3 3 2 1 1 - - 1 - 1 2 3 2
C206.3 3 3 3 2 1 1 - - 1 - 1 2 3 2
C206.4 3 3 3 2 1 1 - - 1 - 1 2 3 2
C206.5 3 3 3 2 1 1 - - 1 - 1 2 3 3
C206 3 3 3 2 1 1 - - 1 - 1 2 3 2.4
SYLLABUS
Subject:DataStructuresUsingCLab Code:BCS-351
BCS351- Data StructureLab
List of Experiments (Indicative & not limitedto)
1. Implementing SortingTechniques: Bubble Sort, InsertionSort, SelectionSort, Shell,
Sort, Radix Sort, Quick sort
2. Implementing Searching and Hashing Techniques: Linear search, Binary search,
Methods for Hashing: Modulo Division, Digit Extraction, Fold shift, Fold Boundary,
Linear Probe forCollisionResolution. Direct and Subtractionhashing
3. Implementing Stacks: Arrayimplementation, LinkedList implementation, Evaluation
of postfix expression and balancing of parenthesis, Conversion of infix notation to
postfixnotation
4. Implementing Queue: Linked List implementation of ordinary queue, Array
implementation of circular queue, Linked List implementation of priority queue,
Double ended queue
5. Implementing Linked List: Singly Linked Lists, Circular Linked List, Doubly Linked
Lists: Insert, Display, Delete, Search, Count, Reverse(SLL), Polynomial, Addition,
Comparative studyof arrays and linkedlist
6. Implementing Trees: Binary search tree: Create, Recursive traversal: preorder,
post order, in order, Search Largest, Node, Smallest Node, Count number of nodes,
Heap: Min Heap, Max Heap: reheap Up, reheap Down, Delete, Expression Tree,
Heapsort
7. Implementing Graphs: Represent a graphusingthe AdjacencyMatrix, BFS, Findthe
minimum spanning tree (using any method Kruskal’ s Algorithm or Prim’ s
Algorithm)Self Learning Topics: Shortest PathAlgorithm
LIST OF PROGRAMS
Subject:Data StructuresUsingCLab Code:BCS-351
LIST OF PROGRAMS
Subject: Data Structure Using C Lab Code:BCS-351
Exp. No NAME OF EXPERIMENT MAPPING
WITH CO
1 ProgramforImplementation of Bubble Sort Algorithm CO206.1
2 ProgramforImplementation of SelectionSort Algorithm CO206.1
3 ProgramforImplementation of Quick Sort Algorithm CO206.1
4 ProgramforImplementation of Shell Sort Algorithm CO206.1
5 ProgramforBinary SearchAlgorithm CO206.1
6 ProgramforStackimplementationthroughArray CO206.3
7 ProgramforQueue implementationthroughArray CO206.3
8 ProgramforCircular Queue implementationthroughArray CO206.3
9 ProgramforStackimplementationusing dynamic memory CO206.2
allocation
10 Programfor queue implementationusing dynamic memory CO206.2
allocation
11 Programfor Circular Queue implementationusing dynamic CO206.2
memory allocation
12 Program for List implementation using dynamic memory CO206.2
allocation
13 Programfor implementationof BinaryTree CO206.4
14 Program for implementation of Binary Search Tree and CO206.4
traverse the tree inPreorder, Post order, andIn order
15 Programfor Implementationof Breadth First SearchAlgorithm CO206.5
16 Programfor Implementationof DepthFirst SearchAlgorithm CO206.5
EXPERIMENT NO. -1
AIM: ProgramforImplementationofBubbleSortAlgorithm
Program in C:
#include<stdio.h>
voidbubble_sort(int a[], int size);
int main(void) {
int arr[10]= {10, 2, 4, 1, 6, 5, 8, 7, 3, 9};
int i = 0;
printf("before:\n");
for(i = 0; i<10; i++)printf("%d ", arr[i]);
printf("\n");
bubble_sort(arr, 10);
printf("after:\n");
for(i = 0; i < 10; i++)printf("%d", arr[i]);
printf("\n");
return0;
}
voidbubble_sort(int a[], int size) {
int switched= 1;
int hold = 0;
int i = 0;
int j = 0;
size -= 1;
for(i = 0; i < size && switched; i++){
switched = 0;
for(j = 0; j < size - i; j++)
if(a[j]>a[j+1]) {
switched= 1;
hold = a[j];
a[j]= a[j + 1];
a[j + 1]= hold;
}
}
}
OUTPUT:
before:
10 2 4 16 587 3 9
after:
12 3 45 67 8 910
EXPERIMENT NO. – 2
AIM: ProgramforProgramforimplementation ofSelectionSort
Program in C:
#include<stdio.h>
voidselection_sort(int a[], int size);
int main(void) {
int arr[10]= {10, 2, 4, 1, 6, 5, 8, 7, 3, 9};
int i = 0;
printf("before:\n");
for(i = 0; i<10; i++)printf("%d ", arr[i]);
printf("\n");
selection_sort(arr, 10);
printf("after:\n");
for(i = 0; i<10; i++)printf("%d ", arr[i]);
printf("\n");
return0;
}
voidselection_sort(int a[], int size){
int i = 0;
int j = 0;
int large = 0;
int index = 0;
for(i = size - 1; i > 0; i--){
large = a[0];
index = 0;
for(j = 1; j <= i; j++)
if(a[j]> large) {
large = a[j];
index = j;
}
a[index] = a[i];
a[i] = large;
}
}
OUTPUT:
before:
10 2 4 16 587 3 9
after:
12 3 45 67 8 910
EXPERIMENT NO. – 3
AIM: Programtosort elementsofgiven array usingQuickSort Algorithm
Program in C:
#include<stdio.h>
#include<conio.h>
#define max15
int beg,end,top,i,n,loc,left,right;
int array[max+1]; //contains the various elements.
int upper[max-1],lower[max-1];
//two stacksto store twoends of the list.
voidmain()
{
void enter(void);
void quick(void);
void prnt(void);
clrscr();
enter(); //entering elementsinthe array
top=i-1; //set top to stack
if (top==0)
{
printf(" UNDERFLOW CONDITION ");
getch();
exit();
}
top=0;
if(n>1)
{
top++;
lower[top]=1;upper[top]=n;
while ( top!=NULL )
{
beg=lower[top];
end=upper[top];
top--;
left=beg;
right=end;
loc=beg;
quick();
if (beg<loc-1)
{
top++;
lower[top]=beg;
upper[top]=loc-1;
}
if(loc+1<end)
{
top++;
lower[top]=loc+1;
upper[top]=end;
}
} //end of while
} //end of if statement
printf("Sorted elements of the arrayare :");
prnt(); //to print the sortedarray
getch();
} //end of main

void enter(void)
{
printf("Enterthe no of elements inthe array:");
scanf("%d",&n);
printf("Enterthe elements of the array:");
for(i=1;i<=n;i++)
{
printf(" Enter the %d element :",i);
scanf("%d",&array[i]);
}
}

void prnt(void)
{
for(i=1;i<=n;i++)
{
printf(" The %d element is : %d",i,array[i]);
}
}
voidquick()
{
int temp;
void tr_fr_right(void);
while(array[loc]<=array[right]&& loc!=right)
{
right--;
}
if(loc==right)
return;
if(array[loc]>array[right])
{
temp=array[loc];
array[loc]=array[right];
array[right]=temp;
loc=right;
tr_fr_right();
}
return;
}
void tr_fr_right()
{
int temp;
while(array[loc]> array[left] && loc!=left)
{
left++;
}
if(loc==left)
return;
if(array[loc] < array[left])
{
temp=array[loc];
array[loc]=array[left];
array[left]=temp;
loc=left;
quick();
}
return;
}
OUTPUT:
EXPERIMENT NO. – 4
AIM: ProgramforimplementationofShell Sort.
Program in C:-
#include<stdio.h>
#include<conio.h>
#define MAX 15
voidmain()
{
int arr[MAX], i,j,k,n,incr;
clrscr();
printf("\nEnterthe number of elements :");
scanf ("%d",&n);
for (i=0;i<n;i++)
{
printf ("\nEnterelement %d:", i+1);
scanf("%d",&arr[i]);
}
printf ("\nUnsorted list is :\n");
for (i = 0; i<n; i++)
printf("%d ",arr[i]);
printf ("\nEntermaximum increment (odd value):");
scanf("%d",&incr);
/*Shell sort algorithmis applied*/
while(incr>=1)
{
for (j=incr;j<n;j++)
{
k=arr[j];
for (i=j-incr; i >= 0 && k < arr[i]; i = i-incr)
arr[i+incr]= arr[i];
arr[i+incr]= k;
}
incr=incr-2; /*Decrease the increment */
}
printf("\nSorted list is : \n\n");
for (i = 0; i<n; i++)
printf("%d", arr[i]);
getch();
}
OUTPUT:
Enterthe number of elements:6
Enterelement 1: 25
Enterelement 2: 10
Enterelement 3: 15
Enterelement 4 : 5
Enterelement 5 : 30
Enterelement 6: 20
Unsorted list is: 25 10 15 5 30 20
Entermaximumincrement (odd value) : 3
Sorted list is : 5 10 15 20 25 30
Experiment No. 5
AIM:ProgramforSearchingAlgorithm “BinarySearch” .
Program in C:
#include<stdio.h>
#define TRUE 0
#define FALSE 1
int main(void) {
int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int left = 0;
int right = 10;
int middle = 0;
int number = 0;
int bsearch= FALSE;
int i = 0;
printf("ARRAY: ");
for(i = 1; i <= 10; i++)
printf("[%d]", i);
printf("\nSearch forNumber: ");
scanf("%d", &number);
while(bsearch== FALSE && left <= right){
middle = (left + right) /2;
if(number== array[middle]) {
bsearch= TRUE;
printf("**Number Found**\n");
}else {
if(number< array[middle])right = middle - 1;
if(number> array[middle])left = middle + 1;
}
}
if(bsearch== FALSE)
printf("-- Number Not found --\n");
return0;
}
OUTPUT:
ARRAY: [1][2][3] [4][5] [6] [7][8] [9][10]
Searchfor Number: 7
**NumberFound **
Experiment No. 6
AIM:ProgramforStackimplementationusingArray
Program in C:
#include<stdio.h>
#include<ctype.h>
#define MAXSIZE 200;
int stack[MAXSIZE];
int top; //index pointing tothe top of stack
voidmain()
{
voidpush(int);
int pop();
int will=1,i,num;
clrscr();
while(will ==1)
{printf("MAIN MENU:
[Link] to stack
[Link] element from the stack");
scanf("%d",&will);
switch(will)
{
case 1:
printf("Enterthe data... ");
scanf("%d",&num);
push(num);
break;
case 2: i=pop();
printf("Value returned from popfunctionis %d ",i);
break;
default: printf("Invalid Choice . ");
}
printf("Do you want todomore operations onStack (1foryes, anyother keyto exit)");
scanf("%d" ,&will);
}//endof outerwhile
} //end of main
voidpush(int y)
{
if(top>MAXSIZE)
{
printf("STACK FULL");
return;
}
else
{
top++;
stack[top]=y;
}
}
int pop()
{
int a;
if(top<=0)
{
printf("STACK EMPTY");
return0;
}
else
{
a=stack[top];
top--;
}
return(a);
}
OUTPUT:
Experiment No. 7
AIM:ProgramforQueueimplementation usingArray
Program in C:
#include<stdio.h>
#include<ctype.h>
#define MAXSIZE 200
int q[MAXSIZE];
int front, rear;
voidmain()
{
voidadd(int);
int del();
int will=1,i,num;
front =0;
rear= 0;
clrscr();
printf("Programfor queue demonstrationthrougharray");
while(will ==1)
{
printf("MAIN MENU:
[Link] to queue
[Link] element from the queue");
scanf("%d",&will);
switch(will)
{
case 1:
printf("Enterthe data... ");
scanf("%d",&num);
add(num);
break;
case 2: i=del();
printf("Value returned from delete functionis %d ",i);
break;
default: printf("Invalid Choice ... ");
}
printf("Do you want to do more operations on Queue ( 1for yes, anyotherkeyto exit)");
scanf("%d" ,&will);
}
}
voidadd(int a)
{
if(rear>MAXSIZE)
{
printf("QUEUE FULL");
return;
}
else
{
q[rear]=a;
rear++;
printf("Value of rear= %d and the value of front is %d",rear,front);
}
}
int del()
{
int a;
if(front == rear)
{
printf("QUEUE EMPTY");
return(0);
}
else
{
a=q[front];
front++;
}
return(a);
}
OUTPUT:
Experiment No. 8
AIM:ImplementationofCircularQueueusingArray.
Program in C:
#include<stdio.h>
#include<ctype.h>
#define MAXSIZE 200
int cq[MAXSIZE];
int front,rear;
voidmain()
{
voidadd(int,int [],int,int,int);
int del(int [],int,int ,int );
int will=1,i,num;
front = 1;
rear= 1;
clrscr();
printf("Programfor Circular Queue demonstrationthrougharray");
while(will ==1)
{
printf("MAIN MENU:
[Link] to CircularQueue
[Link] element from the CircularQueue");
scanf("%d",&will);
switch(will)
{
case 1:
printf("Enterthe data... ");
scanf("%d",&num);
add(num,cq,MAXSIZE,front,rear);
break;
case 2: i=del(cq,MAXSIZE,front,rear);
printf("Value returned from delete functionis %d ",i);
break;
default: printf("Invalid Choice . ");
}
printf("Do you want to do more operations on CircularQueue ( 1for yes, anyotherkeyto exit)");
scanf("%d" ,&will);
}//endof outerwhile
} //end of main
voidadd(int item,int q[],int MAX,int front,int rear)
{
rear++;
rear= (rear%MAX);
if(front ==rear)
{
printf("CIRCULARQUEUE FULL");
return;
}
else
{
cq[rear]=item;
printf("Rear = %d Front = %d ",rear,front);
}
}
int del(int q[],int MAX,int front,int rear)
{
int a;
if(front == rear)
{
printf("CIRCULARSTACKEMPTY");
return(0);
}
else
{
front++;
front = front%MAX;
a=cq[front];
return(a);
printf("Rear = %d Front = %d ", rear, front);
}
}
OUTPUT:

You might also like