0% found this document useful (0 votes)
14 views51 pages

DSA Manual Updated

The document outlines the vision, mission, and educational objectives of the Shri G.S. Institute of Technology & Science, Indore, specifically for the Department of Electrical Engineering. It details the program educational objectives, specific outcomes, and outcomes for students in the B.Tech. III Year, focusing on Data Structures and Embedded System Programming. Additionally, it includes a series of programming assignments and assessments designed to enhance students' practical skills in C programming and embedded systems.
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)
14 views51 pages

DSA Manual Updated

The document outlines the vision, mission, and educational objectives of the Shri G.S. Institute of Technology & Science, Indore, specifically for the Department of Electrical Engineering. It details the program educational objectives, specific outcomes, and outcomes for students in the B.Tech. III Year, focusing on Data Structures and Embedded System Programming. Additionally, it includes a series of programming assignments and assessments designed to enhance students' practical skills in C programming and embedded systems.
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
You are on page 1/ 51

SHRI G.S.

INSTITUTEOFTECHNOLOGY &
SCIENCE

INDORE-452003
(ANAUTONOMOUS INSTITUTE, ESTABLISHED IN1952)

LABORATORY JOURNAL
B.Tech. III YEAR

Name of students Enrollment Number

Geetansh Waldhurkar 0801EE221044

DEPARTMENT OF ELECTRICAL ENGINEERING


Vision & Missionof Institute
Vision
Afront-line institute inTechnology&Science making significant contribution to human
resource development envisaging dynamic needs of the society.

Mission
To generate experts in Science & Technology akin to society for its accelerated socio-
economic growth in professional and challenging environment,imparting human values.

Vision &Mission of Department


Vision
To develop leading expertise in Electrical Engineering field making significant
contribution to human resource development envisaging dynamic needs of thesociety
and industries

Mission
To produce higher levels of human resources in the field of Electrical Engineering for
Nation’s accelerated socio-economical and technological growth in emerging areas of
human endeavour
Program Educational Objectives(PEOs)
PEO_1:To impart core knowledge of Electrical Engineering for technical careers.
PEO_2:To teach the advanced aspects of Electrical systems along with its design,
simulation and fabrication together with good communication skills.

PEO_3:To motivate students for higher studies in Electrical Engineering so as to develop high
vision in the technical career.

PEO_4:To attain professional excellence through lifelong learning.

PEO_5:To produce graduates to ensure ethical& moral behavior.

Programme Specific Outcomes (PSOs)

PSO#1: Demonstrate fundamental knowledge of mathematics, science and engineering to


identify, formulate, analyse, investigate and solve complex problems in the field of
electrical engineering.

PSO#2: Apply the appropriate techniques and modern engineering tools to design and
develop complex electrical engineering projects, adapt in multi-disciplinary
environments and engage in life-long learning.

PSO#3: Propose & implement engineering solutions in the context of environment, society,
economy, professional ethics and have good communication skills.
Programme Outcomes(POs)

PO#1:Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex
engineering

PO#2: Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.

PO#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, and environmental considerations

PO#4: Conduct investigations of complex problems: Use research-based knowledge and


researchmethodsincludingdesignofexperiments,analysisandinterpretationofdata, and
synthesis of the information to provide valid conclusions.

PO#5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.

PO#6:The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.

PO#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.

PO#8: Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.

PO#9: Individual and teamwork: Function effectively as an individual, and as a member


or leader in diverse teams, and in multidisciplinary settings

PO#10: Communication: 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

PO#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.

PO#12 :Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change. s
OBJECTIVES: The Data Structure and Embedded System Programming Concept Laboratory is
designed:

1.​ To develop programs to implement algorithms of engineering problems.


2.​ In this lab, students are expected to get hands-on experience in data strcture.
3.​ Todevelopcommunicationskillthroughlaboratorynotebookwithwrittendescriptions of
code, flowchart and results.
4.​ Togetexposureforvariousreal-lifeapplicationinthedomainofembedded system.

LABORATORYOUTCOMES:

The students will be able to:

1.​ Write simple C programs to get acquainted with computer programming.


2.​ Create data structure tool like link list, array etc.
3.​ Design STACK and QUEUE using link list and array.
4.​ DevelopandInegratesortingalgorithmstothereallifeapplicationsoflargedatasets.
5.​ Identifyinterruptlatencyrequirementandsharedataprobleminindustrailapplications.

ASSESSMENT:
A.​ Continuous evaluation of laboratory journals with a weight-age of 40%. It includes
lab attendance as well as experiments performed in the lab.
B.​Theend-termpracticalexaminationweight-ageis60%.

CO-POMAPPING:

CO’s PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12

CO1 1 1 3 2 2

CO2 3 1 2 2 3 2 2

CO3 1 3 3 3 2 2 2

CO4 3 3 3 2 2 2 2 2 2 2

CO5 3 3 3 3 3 2 2 3 2 1 3 3
CONTENTS
CO’S
Page
S.No Name of Experiment no

1 Programming Assignment

Write a Hello world program using C.

Write a C program to find the roots of quadratic equation.

Write a C program to generate Fibonacci series. CO1

Write a C program to find GCD of two numbers.

Write a C program to make simple arithmetic calculator.

Write a C program to make complex number calculator

Write a C program for string multiplication and also perform


following string operations:

a)​ Find string length b) Reverse string with stack and without
stack C) Concatenate two strings d) String matching using
string library.

Write a C program for insertion and deletion of node at the CO2


beginning in the link list.
Write a C program for insertion and deletion of node at specific
position in the link list.
Write a C program for insertion and deletion of node at the end in the
link list.

Write a program in C for implementation of stacks using Linked lists


and array.
Write a program in C for implementation of queue using Linked lists
and array. CO3
Write a program in C for bubble sorting and optimize.
Write a program in C for insertion sort.
Write a program in C for selection sort a) Specific position b)
Specific at sorted order.
Write a program in C for quick sort.
Write a program in C for merge sort.
Write a program in C for insertion of node in binary search tree. CO4
Write a program in C for deletion of node in binary search tree.
Write a program in C for binary tree traversal.

2 Embedded System Project Deign Problem CO5


Laboratory Assessment

S.no Part Grade Faculty Signature

Array: Stack, Queue


1

Link list: stack, Queue


2

Sorting: Bubble sort, Insertion


3 sort, Selection sort, merge sort,
quick sort
Searching, Tree
4

Embedded System Project Deign


5 Problem
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 01

Objective: Write a Hello world program using C.

Tools Used:

Program
Code:

#include <stdio.h>

int main(){

printf("HelloWorld!\n”);

return 0;

}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 02

Objective: Write a C program to find the roots of quadratic equation.

Tools Used:

Program
Code:

#include <stdio.h>

#include<math.h>

int main()

double a, b, c , D , root1, root2, real , imagenary;

printf("Enter the coeffitcients a, b, c: \n");

scanf("%lf %lf %lf", &a, &b, &c);

if (a==0) {

printf(" itz a linear eq \n");

return 0;

D = ((b*b) - 4*a*c);

if (D >0) {

root1 = (-b + sqrt(D))/(2*a);

root2 = (-b - sqrt(D))/(2*a);

printf("Two distinct real roots are : %lf and %lf \n", root1, root2);

else if (D==0) {

root1 = -b/(2*a);
root2= (-b)/(2*a);

printf("The root of the equation are %lf, %lf", root1, root2);

else{

real = -b/ (2*a);

imagenary = sqrt(-D)/ (2*a);

printf(" Equation have complex roots: %lf + i%lf \n", real, imagenary);

printf(" Equation have complex roots: %lf - i%lf \n", real, imagenary);

return 0;

}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 03

Objective: Write a C program to generate Fibonacci series

Tools Used:

Program
Code:

#include<stdio.h>

void fibonacci(int x) {

int t1= 0, t2 = 1, next;

printf("Fibonacci Series: ");

for (int i=1; i<=n; ++i) {

printf("%d, ", t1);

next = t1 + t2;

t1 = t2;

t2 = next;

printf("\n");

int main() {

int n;

printf("Enter a positive integer: \n");

else{

fibonacci(n);

return 0;

}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 04

Objective: Write a C program to find GCD of two numbers


Tools Used:
Program Code:

#include <stdio.h>

int main() {
​ int n1, n2;

printf("Enter two numbers: ");
scanf("%d %d", &n1, &n2);

if (n1 <= 0 || n2 <= 0) {


​ printf("kindly Enter positive intefer. \n");
​ return 1;
}

int smaller = (n1 < n2) ? n1 : n2;


int gcd = 1;

for(int i = 1; i<= smaller; i++) {


if(n1 %i ==0 && n2%i ==0) {
​ gcd = i;
​ }
}
printf("GCD of given numbers is: %d \n", gcd);

return 0;
}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 05

Objective: Write a C program to make simple arithmetic calculator.


Tools Used:
Program Code:
#include<stdio.h>
void fibonacci(int x) {
int t1= 0, t2 = 1, next;
printf("Fibonacci Series: ");

for (int i=1; i<=n; ++i) {


printf("%d, ", t1);
next = t1 + t2;
t1 = t2;
t2 = next;
}
printf("\n");
}

int main() {
int n;
printf("Enter a positive integer: \n");
}
else{
fibonacci(n);
}
return 0;
}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 06

Objective: Write a C program to create a complex calculator..


Tools Used:
Program Code:
#include <stdio.h>

typedef struct {
​ double real;
​ double imag;
​ } Complex;

Complex addComplex(Complex num1, Complex num2) {


​ Complex result;
​ result.real = num1.real + num2.real;
​ result.imag = num1.imag + num2.imag;
​ return result;
}
//substraction//
Complex substractComplex(Complex num1, Complex num2) {
​ Complex result;
​ result.real = num1.real - num2.real;
​ result.imag = num1.imag - num2.imag;
​ return result;
}
//multiply//
Complex multiplyComplex(Complex num1, Complex num2) {
​ Complex result;
​ result.real = (num1.real * num2.real) - (num1.imag * num2.imag);
​ result.imag = (num1.real * num2.real) + (num1.imag * num2.imag);
​ return result;
}
//divide//

Complex divideComplex(Complex num1, Complex num2) {


​ Complex result;
​ double D = (num2.real * num2.real) + (num2.imag * num2.imag);

​ if(D == 0) {
​ ​ printf("error!!! \n");
​ ​ result.real = result.imag = 0;
​ ​ }
​ else {
​ ​ result.real = (num1.real * num2.real + num1.imag*num2.imag)/ D;
​ ​ result.imag = (num1.real * num2.real - num1.imag*num2.imag)/ D;
}
​ return result;
}

void printComplex(Complex num) {


​ if(num.imag>= 0) {
​ printf("%lf + i %lf \n", num.real, num.imag);
​ }
​ else {
​ printf("%lf - i %lf \n", num.real, -num.imag);
​ }
}

int main() {
​ Complex num1, num2, result;
​ int choice;

​ printf("Complex number calculator \n");

printf("Enter the first complex number: ");
scanf("%lf %lf", &num1.real, &num1.imag);

printf("Enter the second complex number: ");


scanf("%lf %lf", &num2.real, &num2.imag);

printf("Enter the operation you'd like: \n");


printf("1. Add \n");
printf("2. substraction \n");
printf("3. Multiplication \n");
printf("4. division\n");
printf("Enter your choice (1-4): ");
scanf("%d", &choice);

switch (choice) {
​ case 1:
​ ​ result = addComplex(num1, num2);
​ ​ printf("\nResult:");
​ ​ printComplex(result);
​ ​ break;
​ case 2:
​ ​ result = substractComplex(num1, num2);
​ ​ printf("\nResult:");
​ ​ printComplex(result);
​ ​ break;
​ case 3:
​ ​ result = multiplyComplex(num1, num2);
​ ​ printf("\nResult:");
​ ​ printComplex(result);
​ ​ break;
​ case 4:
​ ​ result = divideComplex(num1, num2);
​ ​ if (result.real !=0 || result.imag != 0) {
​ ​ printf("\nResult:");
​ ​ printComplex(result);
​ ​ }
​ ​ break;
​ default:
​ ​ printf("Invalid Choice! \n");
​ ​ }
return 0;
}
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 07

Objective: Write a C program for string multiplication and also perform following string
operations:

a)​ Find string length b) Reverse string with stack and without stack C) Concatenate two
strings d) String matching using string library.

Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 08

Objective: Write a C program for insertion and deletion of node at the beginning in the link list.
Tools Used:
Program Code:
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
void insertAtBeginning(struct Node** head_ref, int new_data) {

struct Node* new_node = (struct Node*)malloc(sizeof(struct Node));

if (new_node == NULL) {
printf("Memory allocation failed!\n");
return;
}
new_node->data = new_data;
new_node->next = *head_ref;
*head_ref = new_node;

printf("%d inserted at the beginning\n", new_data);


}
void deleteAtBeginning(struct Node** head_ref) {
if (*head_ref == NULL) {
printf("List is empty! Cannot delete.\n");
return;
}
struct Node* temp = *head_ref;
*head_ref = (*head_ref)->next;
free(temp);
printf("Node deleted from the beginning\n");
}

void displayList(struct Node* node) {


if (node == NULL) {
printf("List is empty\n");
return;
}
printf("Linked List: ");
while (node != NULL) {
printf("%d -> ", node->data);
node = node->next;
}
printf("NULL\n");
}

int main() {
struct Node* head = NULL; // Initialize empty list
int choice, value;

while(1) {
printf("\n--- Linked List Operations ---\n");
printf("1. Insert at beginning\n");
printf("2. Delete from beginning\n");
printf("3. Display list\n");
printf("4. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);

switch(choice) {
case 1:
printf("Enter value to insert: ");
scanf("%d", &value);
insertAtBeginning(&head, value);
break;

case 2:
deleteAtBeginning(&head);
break;

case 3:
displayList(head);
break;

case 4:
printf("Exiting program...\n");
exit(0);

default:
printf("Invalid choice! Please try again.\n");
}
}
return 0;​ }
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 09

Objective: Write a C program for insertion and deletion of node at specific position in the link list.

Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 10

Objective: Write a C program for insertion and deletion of node at the end in the link list.
Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 11

Objective: Write a program in C for implementation of stacks using Linked lists and array.
Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 12

Objective: Write a program in C for implementation of queue using Linked lists and array.
Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 13

Objective: Write a program in C for bubble sorting and optimize.


Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 14

Objective: Write a program in C for insertion sort.


Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 15

Objective: Write a program in C for selection sort a) Specific position b) Specific at sorted order.
Tools Used:
Program Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 16

Objective: Write a program in C for quick sort.


Tools Used:
Program
Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 17

Objective: Write a program in C for merge sort.


Tools Used:
Program
Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 18

Objective: Write a program in C for insertion of node in binary search tree.


Tools Used:
Program
Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 19

Objective: Write a program in C for deletion of node in binary search tree.


Tools Used:
Program
Code:
Experimental Result:
Department of Electrical Engineering
EE32606: DATA STRUCTURE AND EMBEDDED SYSTEM
PROGRAMMING CONCEPT
Experiment No- 20

Objective: Write a program in C for binary tree traversal.


Tools Used:
Program
Code:
Experimental Result:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy