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

3130702 Data Structure Lab Manual

The document is a laboratory manual for the Data Structures course (3130702) for B.E. Computer Engineering students at Government Engineering College, Bhavnagar. It outlines the curriculum's focus on practical skills and competencies, providing guidelines for both faculty and students, and details various experiments related to data structures. The manual emphasizes the importance of hands-on experience and industry-relevant skills in the learning process.

Uploaded by

vishvampandya74
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)
10 views

3130702 Data Structure Lab Manual

The document is a laboratory manual for the Data Structures course (3130702) for B.E. Computer Engineering students at Government Engineering College, Bhavnagar. It outlines the curriculum's focus on practical skills and competencies, providing guidelines for both faculty and students, and details various experiments related to data structures. The manual emphasizes the importance of hands-on experience and industry-relevant skills in the learning process.

Uploaded by

vishvampandya74
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/ 104

Degree Engineering

A Laboratory Manual for

Data Structures
(3130702)

[ B.E. (Computer Engineering) : Semester - 3 ]

Enrolment No
Name
Branch
Academic Term
Institute Name

Directorate of Technical Education, Gandhinagar,


Gujarat
Government Engineering College, Bhavnagar
Department of Computer Engineering

CERTIFICATE

This is to certify that Mr./Ms.__________________________________________

Enrollment No. _______________ of B.E. Semester - III from Computer

Engineering Department of this Institute (GTU Code: _021__) has satisfactorily

completed the Practical / Tutorial work for the subject Data structure (3130702)

for the academic year 2023-24.

Place: ___________

Date: ___________

Signature of Course Faculty Head of the Department


Data Structure (3130702) Enrollment No

Preface

Main motto of any laboratory/practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant
competencies in psychomotor domain. By keeping in view, GTU has designed competency
focused outcome-based curriculum for engineering degree programs where sufficient weightage
is given to practical work. It shows importance of enhancement of skills amongst the students
and it pays attention to utilize every second of time allotted for practical amongst students,
instructors and faculty members to achieve relevant outcomes by performing the experiments
rather than having merely study type experiments. It is must for effective implementation of
competency focused outcome-based curriculum that every practical is keenly designed to serve
as a tool to develop and enhance relevant competency required by the various industry among
every student. These psychomotor skills are very difficult to develop through traditional chalk
and board content delivery method in the classroom. Accordingly, this lab manual is designed
to focus on the industry defined relevant outcomes, rather than old practice of conducting
practical to prove concept and theory.

By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each
experiment in this manual begins with competency, industry relevant skills, course outcomes as
well as practical outcomes (objectives). The students will also achieve safety and necessary
precautions to be taken while performing practical.

This manual also provides guidelines to faculty members to facilitate student centric lab
activities through each experiment by arranging and managing necessary resources in order that
the students follow the procedures with required safety and necessary precautions to achieve the
outcomes. It also gives an idea that how students will be assessed by providing rubrics.

Data Structures is a core course in all computer science undergraduate curricula. The course is
the basis for understanding several data structures and also algorithms that operate on them. The
course forms the foundation for almost all computer science subjects: compilers, operating
systems, databases, AI and software engineering. The course comes with a lab in most
universities in India. The associated lab in university curricula focuses on implementation of
algorithms operating on the data structures, i.e., coding programs on the data structures and
algorithms.
Data Structure (3130702) Enrollment No

DTE’s Vision

 To provide globally competitive technical education


 Remove geographical imbalances and inconsistencies
 Develop student friendly resources with a special focus on girls’ education and support to
weaker sections
 Develop programs relevant to industry and create a vibrant pool of technical professionals

Institute’s Vision
To transform the students into good human beings, employable engineering graduates
and continuous learners by inculcating human values and imparting excellence in technical
education.

Institute’s Mission
To provide education to students from the local and rural areas, so that they become enlightened
individuals and improve the living standards of their families, and their contribution to industry
and society. To foster a learning environment with technology integration and individual
attention, so that the students imbibe quality technical knowledge, skill-development and
character building.

Department’s Vision

To achieve excellence for providing value based education in computer science and Information
Technology through innovation, team work and ethical practices.

Department’s Mission

 To produce graduates according to the need of industry, government, society and scientific
community and to develop partnership with industries, government agencies and R & D
Organizations for knowledge sharing and overall development of faculties and students.
 To motivate students/graduates to be entrepreneurs.
 To motivate students to participate in reputed conferences, workshops, symposiums,
seminars and related technical activities.
 To impart human and ethical values in our students for better serving of society.
Data Structure (3130702) Enrollment No

Programme Outcomes (POs)

1. Engineering knowledge: Apply the 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, natural sciences, 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, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis
of the information to provide valid conclusions.
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.
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.
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 and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
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.
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 engage
in independent and life-long learning in the broadest context of technological change
Data Structure (3130702) Enrollment No

Program Specific Outcomes (PSOs)


 An ability to design solutions by simulating computer engineering problems in absence of
real time environment.
 An ability to learn and use of open source tools in the areas like operating systems,
computer programming, computer networks and database management.
 An ability to face competitive examinations for higher education and PSUs.

Program Educational Objectives (PEOs)

 Have careers in industry, research & academics focusing on the application of the
information technologies and take leadership positions in the industry and also initiate
businesses offering innovative solutions.
 Capable of adapting to new technologies and constantly upgrade their skills with an
attitude towards lifelong learning.
 Act conscientiously about the potentials and the responsibilities of the computing
profession in the context of science, technology, society and humanity.
Data Structure (3130702) Enrollment No

Practical – Course Outcome matrix

Course Outcomes (COs)


Define and classify various data structures, storage structures and common
CO_3130702.1
operations on them
Create various linear data structures with their representation and perform
CO_3130702.2
different operations on them
Create various nonlinear data structures with their representation and
CO_3130702.3
perform different operations on them
CO_3130702.4 Apply various searching sorting techniques on data set
Solve the given a problem using an appropriate data structure to achieve
CO_3130702.5 optimal performance and compare its performance with other possible data
structures

Sr. CO CO CO CO CO
Practical Outcome/Title of experiment
No. 1 2 3 4 5
1. Classification of Data Structure and Stack
1.1 Classify various data structures
1.2 Implement a program for stack that performs
following operations using array. (a) PUSH (b) POP
(c) PEEP (d) CHANGE (e) DISPLAY
1.3 Implement a program to convert infix notation to
postfix notation using stack. √ √ √
1.4 Write a program to implement Tower of Hanoi
problem.
1.5 Identify widely used application which use stack
data structure for implementation of its important
feature.
2. Queue
2.1 Write a program to implement QUEUE using arrays
that performs following operations (a) INSERT (b)
DELETE (c) DISPLAY
2.2 Write a program to implement Circular Queue using
arrays that performs following operations. (a) √ √
INSERT (b) DELETE (c) DISPLAY
2.3 Identify widely used application which use Queue
data structure for implementation of its important
feature.
3. Singly linked list
3.1 Write a menu driven program to implement √ √
following operations on the singly linked list.
Data Structure (3130702) Enrollment No

(a) Insert a node at the front of the linked list.


(b) Insert a node at the end of the linked list.
(c) Insert a node such that linked list is in ascending
order. (According to info. Field)
(d) Delete a first node of the linked list.
(e) Delete a node before specified position.
(f) Delete a node after specified position.
3.2 Write a program to implement stack using linked
list.
3.3 Write a program to implement queue using linked
list.
4. Doubly linked list
4.1 Write a program to implement following operations
on the doubly linked list.
(a) Insert a node at the front of the linked list.
√ √
(b) Insert a node at the end of the linked list.
(c) Delete a last node of the linked list.
(d) Delete a node before specified position.
5. Circular linked list
5.1 Write a program to implement following operations
on the circular linked list.
(a) Insert a node at the end of the linked list.
(b) Insert a node before specified position.
√ √
(c) Delete a first node of the linked list.
(d) Delete a node after specified position.
5.2 Identify widely used application which use Linked
List for implementation of its important feature.
6. Tree
6.1 Write a program which create binary search tree.
6.2 Implement recursive tree traversing methods in-
order, pre-order and post-order traversal
√ √
6.3 Identify widely used application which use Tree
data structure for implementation of its important
feature.
7. Graph
7.1 Write a program to perform BFS and DFS on given
graph.
7.2 Identify widely used application which use Graph √ √
data structure for implementation of its important
feature.
Data Structure (3130702) Enrollment No

8. Searching
8.1 Write a program to implement Linear Search.
8.2 Write a program to implement Binary Search.
8.3 Identify widely used application which use √ √
Searching technique for implementation of its
important feature.
9. Sorting
9.1 Write a program to implement Quick Sort
9.2 Write a program to implement Merge Sort
9.3 Write a program to implement Bubble Sort
√ √
9.4 Identify widely used application which use Sorting
technique for implementation of its important
feature.
10 Hashing and File Structure
10.1 Write a program to create hash table and handle
the collision using linear probing.
10.2 Write a program to demonstrate the file
primitives
√ √
such as fopen, fclose, fprintf.
10.3 Identify widely used application which use
Hashing technique for implementation of its
Important feature.
Data Structure (3130702) Enrollment No
Industry Relevant Skills

The following industry relevant competencies are expected to be developed in the student by
undertaking the practical work of this laboratory.
1. Will be able to classify data structures and identify storage representation of
primitive and non-primitive data structures
2. Will be able to implement various operations on Stack, Queue, Link list, Tree,
Graph, Hashing and File operations.
3. Will be able to understand need of sorting and searching for various applications
4. Will be able to apply various data structure to design real time applications in
efficient manner.

Guidelines for Faculty members

1. Teacher should provide the guideline with demonstration of practical to the students
with all features.
2. Teacher shall explain basic concepts/theory related to the experiment to the students
before starting of each practical
3. Involve all the students in performance of each experiment.
4. Teacher is expected to share the skills and competencies to be developed in the
students and ensure that the respective skills and competencies are developed in the
students after the completion of the experimentation.
5. Teachers should give opportunity to students for hands-on experience after the
demonstration.
6. Teacher may provide additional knowledge and skills to the students even though not
covered in the manual but are expected from the students by concerned industry.
7. Give practical assignment and assess the performance of students based on task
assigned to check whether it is as per the instructions or not.
8. Teacher is expected to refer complete curriculum of the course and follow the
guidelines for implementation.

Instructions for Students

1. Students are expected to carefully listen to all the theory classes delivered by the faculty
members and understand the COs, content of the course, teaching and examination
scheme, skill set to be developed etc.
2. Students will have to perform experiments on computer system on which C/C++ compiler
is installed to execute programs of data structure.
3. Students should develop programs and execute all the programs using C/C++ compiler.
Students have to show output of each program in their practical file.
4. Students are instructed to submit practical list as per given sample list shown on next page.
5. Student should develop a habit of submitting the experimentation work as per the schedule
and s/he should be well prepared for the same.
Data Structure (3130702) Enrollment No
Common Safety Instructions

Students are expected to

1. switch on the PC carefully (not to use wet hands)


2. shutdown the PC properly at the end of your Lab
3. carefully handle the peripherals (Mouse, Keyboard, Network cable etc)
4. use Laptop in lab after getting permission from Teacher
5. carefully handle all lab resources
Data Structure (3130702) Enrollment No

Index
(Progressive Assessment Sheet)
Date
Date of Assessme Sign. of
Sr. Page of Remar
No.
Objective(s) of Experiment submiss nt Teacher
No. perfor ks
ion Marks with date
mance

1. Classification of Data Structure and Stack


1.1 Classify various data structures
1.2 Implement a program for stack that
performs following operations using array.
(a) PUSH (b) POP (c) PEEP (d) CHANGE
(e) DISPLAY
1.3 Implement a program to convert infix
notation to postfix notation using stack.
1.4 Write a program to implement Tower of
Hanoi problem.
1.5 Identify widely used application which use
stack data structure for implementation of
its important feature.
2. Queue
2.1 Write a program to implement QUEUE
using arrays that performs following
operations (a) INSERT (b) DELETE (c)
DISPLAY
2.2 Write a program to implement Circular
Queue using arrays that performs
following operations. (a) INSERT (b)
DELETE (c) DISPLAY
2.3 Identify widely used application which use
Queue data structure for implementation of
its important feature.
3. Singly linked list
3.1 Write a menu driven program to
implement following operations on the
singly linked list.
(a) Insert a node at the front of the linked
list.
(b) Insert a node at the end of the linked
list.
(c) Insert a node such that linked list is in
ascending order. (According to info.
Field)
(d) Delete a first node of the linked list.
Data Structure (3130702) Enrollment No

(e) Delete a node before specified


position.
(f) Delete a node after specified position.
3.2 Write a program to implement stack using
linked list.
3.3 Write a program to implement queue using
linked list.
4. Doubly linked list
4.1 Write a program to implement following
operations on the doubly linked list.
(a) Insert a node at the front of the linked
list.
(b) Insert a node at the end of the linked
list.
(c) Delete a last node of the linked list.
(d) Delete a node before specified
position.
5. Circular linked list
5.1 Write a program to implement following
operations on the circular linked list.
(a) Insert a node at the end of the linked
list.
(b) Insert a node before specified
position.
(c) Delete a first node of the linked list.
(d) Delete a node after specified position.
5.2 Identify widely used application which
use Linked List for implementation of its
important feature.
6. Tree
6.1 Write a program which create binary
search tree.
6.2 Implement recursive tree traversing
methods in-order, pre-order and post-order
traversal.
6.3 Identify widely used application which use
Tree data structure for implementation of
its important feature.
7. Graph
7.1 Write a program to perform BFS and DFS
on given graph.
7.2 Identify widely used application which use
Data Structure (3130702) Enrollment No

Graph data structure for implementation of


its important feature.
8. Searching
8.1 Write a program to implement Linear
Search.
8.2 Write a program to implement Binary
Search.
8.3 Identify widely used application which
use Searching technique for
implementation of its important feature.
9. Sorting
9.1 Write a program to implement Quick Sort
9.2 Write a program to implement Merge Sort
9.3 Write a program to implement Bubble Sort
9.4 Identify widely used application which use
Sorting technique for implementation of its
important feature.
10. Hashing and File Structure
10.1 Write a program to create hash table
and handle the collision using linear
probing.
10.2 Write a program to demonstrate the file
primitives such as fopen, fclose, fprintf.
10.3 Identify widely used application which
use Hashing technique for implementation
of its important feature.
Total
Data Structure (3130702) 220210107042
Experiment No – 1
AIM : Classification of Data Structure and Stack

1.1 Classify various data structures


1.2 Implement a program for stack that performs following operations using array. (a) PUSH (b)
POP (c) PEEP (d) CHANGE (e) DISPLAY
1.3 Implement a program to convert infix notation to postfix notation using stack.
1.4 Write a program to implement Tower of Hanoi problem.
1.5 Identify widely used application which use stack data structure for implementation of its
important feature.

Date: 21-08-2023

Competency and Practical Skills: Logic building and programming

Relevant CO: CO1, CO2, CO5

Objectives: (a) To analyze various data structures


(b) To understand the concepts of stack
(c) To implement various applications of the stack

Equipment/Instruments: Computer System with C/C++ compiler

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Data Structure

Data structures are a fundamental concept in computer science that enable efficient storage and
manipulation of data. They are used to organize and store data in a manner that allows for optimal
performance of algorithms. The selection of a suitable data structure begins with the choice of an
abstract data type, which defines the operations that can be performed on the data. Well-designed
data structures can perform a wide range of critical operations while using minimal resources such
as execution time and memory space. In essence, data structure introduction refers to the
arrangement of data in a computer's memory in a way that enables rapid access by the processor
for the required calculations.

Stack

A stack is a data structure that follows the last-in first-out (LIFO) principle, meaning that objects
are inserted and removed from the container in a particular order. In pushdown stacks, only two
1. pg. 13
Data Structure (3130702) 220210107042

operations are allowed: pushing an item onto the stack, and popping an item off the top of the
stack. Access to the stack is limited, as elements can only be added and removed from the top.
When an item is pushed onto the stack, it becomes the new top item. Conversely, when an item is
popped off the stack, it is removed from the top.

To illustrate this concept, consider a stack of books. Just as you can only remove the top book,
you can only add a new book to the top of the stack. A stack can also have a limited capacity. If
the stack is already full and there is no space to add a new item, it is said to be in an overflow
state. On the other hand, if the stack is empty and an item is removed, it is in an underflow state,
meaning that no items are present in the stack to be removed.

A stack is an abstract data structure that operates on the LIFO principle, where the last item added
is the first item to be removed. Items can be inserted and deleted at one end called the top,
creating a structure that resembles a closed tube on one side.

 The add operation of the stack is called push operation


 The delete operation is called as pop operation.
 Push operation on a full stack causes stack overflow.
 Pop operation on an empty stack causes stack underflow.
 SP is a pointer, which is used to access the top element of the stack.
 If you push elements that are added at the top of the stack;
 In the same way when we pop the elements, the element at the top of the stack is deleted.

There are two operations applied on stack they are

(1) PUSH
(2) POP

In-fix- to Postfix Conversion:

Procedure to convert from infix expression to postfix expression is as follows:

1. Start scanning the infix expression from left to right.


2. If the symbol scanned is a left parenthesis, push it onto the stack.
3. If the scanned symbol is an operand, place it directly into the postfix expression output.
4. If the symbol scanned is a right parenthesis, continue to pop all items from the stack and
place them into the postfix expression output until a matching left parenthesis is found.
5. If the scanned symbol is an operator, remove all operators from the stack and place them
in the postfix expression output if and only if the precedence of the operator on top of the
stack is greater than or equal to the precedence of the scanned operator. Then push the
scanned operator onto the stack; otherwise, push the scanned operator onto the stack.

1. pg. 14
Data Structure (3130702) 220210107042

1.1 Classify various data structures

Classification of Data Structures:

Data structures can be classified as

1. Primitive data structure


2. Non-Primitive data structure
(a) Linear data structure
(b) Non-linear data structure

1. Primitive data structures: Primitive data structures are simple data structures
constructed using the standard data types of a computer language. Examples of
primitive data structures include variables, arrays, pointers, structures, unions, and
more. These structures are used to build more complex data structures

2. Non-primitive data structures: Non-primitive data structures are constructed using


primitive data structures and have specific functionality. They can be designed by a
user and are classified into two categories: linear data structures and non-linear data
structures.

(a) Linear data structures

Linear data structures are arranged as a continuous set of data elements in the memory
and can be constructed using array data types. In linear data structures, the adjacency
relationship between data elements is maintained.

Operations applied on linear data structure:

The following list of operations applied on linear data structures

 Add an element
 Delete an element
 Traverse
 Sort the list of elements
 Search for a data element

Examples of linear data structure

 Stack
 Queue
 Tables
 List
 Linked Lists.

1. pg. 15
Data Structure (3130702) 220210107042
(b) Non-linear Data Structure:

Non-linear data structures are not arranged in a continuous manner and include data
structures such as trees and graphs. These structures can be used to represent complex
relationships between data elements.

Operations applied on non-linear data structures:

The following list of operations applied on non-linear data structures.

 Add elements
 Delete elements
 Display the elements
 Sort the list of elements
 Search for a data element

Examples of non-linear data structure

 Tree
 Decision tree
 Graph
 Forest

1. pg. 16
Data Structure (3130702) 220210107042

1.2 Implement a program for stack that performs following operations using array.
(a) PUSH (b) POP (c) PEEP (d) CHANGE (e) DISPLAY

Program:

#include <stdio.h>

int stack[32];
int top =- 1;

int isfull()
{
if (top == 32-1)
{
return 1;
}
else
{
return 0;
}
}

int isempty()
{
if (top == -1)
{
return 1;
}
else
{
return 0;
}
}

void push(int p)
{
if (isfull())
{
printf("Stack is full!!");
}
else
{
top++;
stack[top]=p;
}
}
1. pg. 17
Data Structure (3130702) 220210107042

int pop()
{
if (isempty())
{
return 0;
}
else
{
return stack[top--];
}
}

int peep()
{
if (isempty())
{
return 0;
}
else
{
return stack[top];
}
}

void change(int pos,int p)


{
if(isempty())
{
printf("Your stack is empty\n");
}
else
{
stack[pos]=p;
}
}

void display()
{
int n=0;
printf("Your stack is\n");

while (n<=top)
{
printf("%d", stack[n]);
n++;

1. pg. 18
Data Structure (3130702) 220210107042
printf(" ");
}
printf("\n");
}

int main()
{
int choice, n, i, new;
do
{
printf("1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP \n");
printf("Enter a your choice\n");
scanf("%d", &choice);
switch (choice)
{
case 0:
printf("Exit!");
break;
case 1:
printf("Enter number to push\n");
scanf("%d", &n);
push(n);
break;
case 2:
if(top==-1)
{
printf("Your stack is empty\n");
}
else
{
printf("Your number %d is poped \n", pop());
}
break;
case 3:
if(peep())
{
printf("Your number is %d\n", peep());
}
else
{
printf("Stack is empty\n");
}
break;
case 4:
printf("Enter index and new number:");

scanf("%d %d", &i, &new);


1. pg. 19
Data Structure (3130702) 220210107042
change(i,new);
break;
case 5:
display();
break;
default:
printf("Number is not valid\n");
break;
}
}while(choice!=0);
return 0;
}

Output:

1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP


Enter a your choice
1
Enter number to push
52
1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP
Enter a your choice
1
Enter number to push
42
1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP
Enter a your choice
5
Your stack is
52 42
1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP
Enter a your choice
2
Your number 42 is poped
1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP
Enter a your choice
2
Your number 52 is poped
1.PUSH 2.POP 3.PEEP 4.CHANGE 5.DISPLAY 0.STOP
Enter a your choice
0
Exit!

1.3 Implement a program to convert infix notation to postfix notation using stack.

1. pg. 20
Data Structure (3130702) 220210107042
Program:

#include <stdio.h>
#define size 20

char stack[size];
int top = -1;

int isfull()
{
if (top == size - 1)
{
return 1;
}
else
{
return 0;
}
}

int isempty()
{
if (top == -1)
{
return 1;
}
else
{
return 0;
}
}

void push(char x)
{
if (isfull())
{
printf("Stack is full");
}
else
{
top++;
stack[top] = x;
}

1. pg. 21
Data Structure (3130702) 220210107042
char pop()
{
if (isempty())
{
return 0;
}
else
{
return stack[top--];
}
}

int stp(char c)
{
switch (c)
{
case '#':
return 0;
case '(':
return 1;
case '+':
case '-':
return 3;
case '*':
case '/':
return 5;
case '^':
return 6;
default:
return 8;
}
}

int np(char c)
{
switch (c)
{
case ')':
return 1;
case '+':
case '-':
return 2;
case '*':

case '/':
return 4;
case '^':
1. pg. 22
Data Structure (3130702) 220210107042
return 7;
case '(':
return 9;
default:
return 8;
}
}

void itop(char infix[])


{
char next, t, post[20];
int i = 0, j = 0;

push('#');

while (infix[i])
{
next = infix[i++];
while (np(next) < stp(stack[top]))
{
post[j++] = pop();
}
if (np(next) == stp(stack[top]))
{
t = pop();
}
else
{
push(next);
}
}
while (stack[top] != '#')
{
post[j++] = pop();
}
post[j] = '\0';
printf("Postfix operation: %s", post);
}

int main()
{

char infix[20];
printf("Enter infix expression without space: ");
scanf("%s", infix);
itop(infix);
1. pg. 23
Data Structure (3130702) 220210107042
return 0;
}

Output:

Enter infix expression without space: a*(b/c)^((d-e)+f)


Postfix operation: abc/de-f+^*

1. pg. 24
Data Structure (3130702) 220210107042

1.4 Write a program to implement Tower of Hanoi problem.

Program:

#include<stdio.h>

void toh(int n,char s,char d,char a)


{
if (n==1)
{
printf("Move disk : %c to %c\n", s, d);
}
else
{
toh(n-1,s,a,d);
toh(1,s,d,a);
toh(n-1,a,d,s);
}
}

int main()
{
int n;
printf("Enter no of rings : ");
scanf("%d", &n);
toh(n,'S','D','A');
return 0;
}

Output:

Enter no of rings : 3
Move disk : S to D
Move disk : S to A
Move disk : D to A
Move disk : S to D
Move disk : A to S
Move disk : A to D
Move disk : S to D

1. pg. 25
Data Structure (3130702) 220210107042

1.5 Identify widely used application which use stack data structure for implementation of its
important feature.

Stack Applications:

1. Stack is used by compilers to check for balancing of parentheses, brackets and braces.
2. Stack is used to evaluate a postfix expression.
3. Stack is used to convert an infix expression into postfix/prefix form.
4. In recursion, all intermediate arguments and return values are stored on the processor’s
stack.
5. During a function call the return address and arguments are pushed onto a stack and on
return they are popped off.
6. Depth first search uses a stack data structure to find an element from a graph.

Observations:

1. Stack Implementation:
The stack was successfully implemented using a specific programming language (c
language). The structure was defined as a collection of elements with two primary
operations, push and pop.

2. Characteristics:
The stack followed the Last-In-First-Out (LIFO) order, where the most recently added
element is the first one to be removed. It was limited in size, and attempting to push
elements beyond this limit resulted in a stack overflow. Similarly, trying to pop from an
empty stack resulted in a stack underflow.

3. Push Operation:
The push operation allowed adding elements to the top of the stack. The implementation
correctly handled cases where the stack was full, preventing further additions.

4. Pop Operation:
The pop operation successfully removed the top element from the stack. The
implementation correctly handled cases where the stack was empty, preventing pop
operations.

5. Peep Operation:
If implemented, the peep operation allowed us to view the top element without removing it
from the stack.

Conclusion:
A Stack can be used for evaluating expressions consisting of operands and operators.
Stacks can be used for Backtracking, i.e., to check parenthesis matching in an expression. It can
also be used to convert one form of expression to another form. It can be used for systematic
Memory Management.

1. pg. 26
Data Structure (3130702) 220210107042

Quiz:

(1) List various stack operations


Ans.
- Push: Adds an element to the top of the stack.
- Pop: Removes an element from the top of the stack.
- Peek or Top: Returns the element at the top of the stack without removing it.
- Display: Display the elements of the stack.
- Change: Modify the value of an element in the stack.

(2) Differentiate FIFO and LIFO


Ans.
FIFO:
- In FIFO, the first item that is added (enqueued) is the first one to be removed
- FIFO is typically associated with data structures like queues.

LIFO:
-In LIFO, the last item that is added (pushed) is the first one to be removed (popped)
-LIFO is typically associated with data structures like stacks.

(3) Explain infix, prefix and postfix expressions


Ans.
Infix Expressions:
Infix notation is the most common way humans write mathematical expressions.
Operators are placed between operands.
Parentheses are used to specify the order of operations.
Prefix Expressions:
In prefix notation, also known as Polish notation, operators precede their operands.
There is no need for parentheses to indicate the order of operations because it is
unambiguous.
Postfix Expressions:
In postfix notation, also known as Reverse Polish notation (RPN), operators follow
their operands.
Like prefix notation, postfix notation does not require parentheses to specify the
order of operations.

Suggested Reference:

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G.


Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prentice-Hall International
3. Fundamentals of Computer Algorithms by Horowitz, Sahni, Galgotia Pub. 2001 ed.
4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms

1. pg. 27
Data Structure (3130702) 220210107042
References used by the students:

http://www.geeksforgeeks.org/data-structures/

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 28
Data Structure (3130702) 220210107042

Experiment No: 2

AIM : Queue

2.1 Write a program to implement QUEUE using arrays that performs following
operations (a)INSERT (b) DELETE (c) DISPLAY
2.2 Write a program to implement Circular Queue using arrays that performs following
operations. (a) INSERT (b) DELETE (c) DISPLAY
2.3 Identify widely used application which uses Queue data structure for implementation
of its important feature.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO2, CO5

Objectives: (a) To understand the concepts of Queue


(b) To analyze different algorithms on Queue
(c) To implement various operations on Queue

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Queue

A queue is a data structure that follows the First In, First Out (FIFO) principle. It is a special type
of list where items are inserted at the rear and deleted from the front end. Queues can be
compared to real-world scenarios, such as people waiting in line at a bank.

There are various types of Queue in data structure

 Queue
 Circular Queue
 D-Queue
 Priority Queue

1. pg. 29
Data Structure (3130702) 220210107042

2.1 Write a program to implement QUEUE using arrays that performs following
operations. (a)INSERT (b) DELETE (c) DISPLAY

Program:

#include <stdio.h>
#define MAX 10

int queue[MAX];
int rear = -1;
int front = -1;

void insert()
{
int item;
printf("Enter the element: ");
scanf("%d", &item);

if(rear == MAX-1)
{
printf("Queue overflow \n");
return;
}

if(front == -1)
{
front = 0;
}
rear++;
queue[rear] = item;
}

void delete()
{
if(front == -1 || front > rear)
{
printf("Queue underflow \n");
return;
}
printf("Deleted element: %d\n", queue[front]);
front++;
}

1. pg. 30
Data Structure (3130702) 220210107042
void display()
{
if(front == -1)
{
printf("Queue is empty\n");
return;
}

for(int i = front; i <= rear; i++)


{
printf("%d ", queue[i]);
}
printf("\n");
}

int main()
{
int choice;
while(1)
{
printf("1. Insert\n");
printf("2. Delete\n");
printf("3. Display\n");

printf("Enter your choice: ");


scanf("%d", &choice);

switch(choice)
{
case 1:
insert();
break;
case 2:
delete();
break;
case 3:
display();
break;
default:
printf("Invalid choice\n");
}
}

return 0;
}

Output:
1. pg. 31
Data Structure (3130702) 220210107042

1. Insert
2. Delete
3. Display
0. Stop
Enter your choice: 1
Enter the element: 5
1. Insert
2. Delete
3. Display
0. Stop
Enter your choice: 1
Enter the element: 9
1. Insert
2. Delete
3. Display
0. Stop
Enter your choice: 3
59
1. Insert
2. Delete
3. Display
0. Stop
Enter your choice: 2
Deleted element: 5
1. Insert
2. Delete
3. Display
0. Stop
Enter your choice: 0

1. pg. 32
Data Structure (3130702) 220210107042

2.2 Write a program to implement Circular Queue using arrays that performs following
operations. (a) INSERT (b) DELETE (c) DISPLAY

Program:

#include <stdio.h>
#define MAX 5

int queue[MAX];
int front = -1, rear = -1;

void enqueue() {
int item;
printf("Enter element to insert: ");
scanf("%d", &item);

if((front == 0 && rear == MAX-1) || (rear == (front-1)%(MAX-1))) {


printf("Queue is Full\n");
return;
}

if(front == -1)
front = 0;

rear = (rear + 1) % MAX;


queue[rear] = item;
}

void dequeue() {
if(front == -1) {
printf("Queue is empty\n");
return;
}

printf("Deleted element: %d\n", queue[front]);


front = (front + 1) % MAX;
}

void display() {
int i;
if(front == -1) {
printf("Queue is empty\n");
return;
}

1. pg. 33
Data Structure (3130702) 220210107042
printf("Queue elements: ");

for(i = front; i != rear; i = (i + 1) % MAX) {


printf("%d ", queue[i]);
}
printf("%d", queue[i]);
printf("\n");
}

int main() {
int choice;
while(1) {
printf("1. Insert\n");
printf("2. Delete\n");
printf("3. Display\n");
printf("0. Stop\n");

printf("Enter choice: ");


scanf("%d", &choice);

switch(choice)
{
case 1:
enqueue();
break;
case 2:
dequeue();
break;
case 3:
display();
break;
case 0:
return 0;
default:
printf("Invalid choice\n");
break;
}
}

return 0;
}

1. pg. 34
Data Structure (3130702) 220210107042

Output:

1. Insert
2. Delete
3. Display
0. Stop
Enter choice: 1
Enter element to insert: 85
1. Insert
2. Delete
3. Display
0. Stop
Enter choice: 1
Enter element to insert: 95
1. Insert
2. Delete
3. Display
0. Stop
Enter choice: 3
Queue elements: 85 95
1. Insert
2. Delete
3. Display
0. Stop
Enter choice: 2
Deleted element: 85
1. Insert
2. Delete
3. Display
0. Stop
Enter choice:0

1. pg. 35
Data Structure (3130702) 220210107042

2.3 Identify widely used application which uses Queue data structure for implementation
of its important feature.

Print Spooling: In computer systems, print spooling is a common application


that uses a queue data structure. When multiple print jobs are sent to a
printer, they are placed in a queue, and the printer processes them in the
order they were received. This ensures that print jobs are executed in a first-
come, first-served manner.

Operating System Process Scheduling: Operating systems use queues for


process scheduling. Processes in a multitasking environment are placed in
queues, and the operating system's scheduler determines the order in which
processes are executed based on scheduling algorithms like First-Come-First-
Served (FCFS), Round Robin, or Priority Scheduling.

Task Queues in Web Servers: Web servers often use queues to manage incoming requests. Each
incoming request is placed in a queue, and the server processes them one by one. This ensures that
requests are handled in the order they were received, preventing overload and ensuring fairness.

Observations:

Efficient Request Handling:


Web servers handle a large number of incoming requests from clients. By
utilizing a queue data structure, they can efficiently manage these
requests. Each incoming request is placed in a queue, ensuring that
requests are processed in the order they are received (FIFO). This
prevents overload situations where too many requests could overwhelm
the server. Queues enable the server to handle requests systematically,
ensuring fairness and optimal resource utilization.

Error Handling:
Queues can be used to manage error handling tasks within web servers.
For instance, failed requests or errors encountered during request
processing can be logged in a queue for further analysis or reporting. This
information can aid administrators in diagnosing issues and improving the
server's reliability.

Conclusion:
queues are fundamental data structures essential for orderly task execution, load balancing,
and efficient resource management. Their applications, exemplified in web servers, showcase
their versatility in ensuring responsive performance, handling errors, and enabling
asynchronous processing. Queues, through their simplicity and effectiveness, continue to be a
cornerstone in various computing scenarios, demonstrating their critical role in modern
software systems.

1. pg. 36
Data Structure (3130702) 220210107042
Quiz:

(1) Explain concepts of Queue


A queue follows the First-In-First-Out (FIFO) principle, where elements are added at
the rear and removed from the front. It ensures orderly processing and is vital for tasks

requiring a specific sequence of execution.

(2) Define DQueue


Dequeue, or Double-Ended Queue, allows insertion and deletion from both ends (front
and rear). It offers flexibility in operations, making it useful for various data structures
like queues and stacks.

(3) Differentiate Circular Queue and Priority Queue


Circular Queue: Optimizes memory usage, forming a circular structure for continuous
access.
Priority Queue: Processes elements based on assigned priorities, ensuring high-priority
tasks are handled promptly.

Suggested Reference:

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G.


Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prenctice-Hall International

3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 2001 ed.


4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms

References used by the students:

http://www.geeksforgeeks.org/data-structures/

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 37
Data Structure (3130702) 220210107042

Experiment No: 3

AIM : Singly linked list

3.1 Write a menu driven program to implement following operations on the singly linked
list.
(a) Insert a node at the front of the linked list.
(b) Insert a node at the end of the linked list.
(c) Insert a node such that linked list is in ascending order. (According to INFO field)
(d) Delete a first node of the linked list.
(e) Delete a node before specified position.
(f) Delete a node after specified position.
3.2 Write a program to implement stack using linked list
3.3 Write a program to implement queue using linked list.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO2, CO5

Objectives: (a) To understand the concepts of singly linked list


(b) To analyze different algorithms on singly link list
(c) To implement various operations on singly link list

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Singly link list

A linked list is a type of data structure that stores a collection of non-sequential data items. Unlike
arrays, linked lists are dynamic and their size can be changed during program execution. Each
data item in a linked list has a pointer that holds the memory address of the next data item in the

1. pg. 38
Data Structure (3130702) 220210107042
list. The data items in a linked list may not be stored in consecutive memory locations, but their
pointers make it easy to access them in any order.

A singly linked list, also known as a linear linked list, is a type of linked list in which all nodes are
connected together sequentially. Each node in a singly linked list contains data and a pointer to
the next node. The last node's pointer is set to null. The limitation of a singly linked list is that it
can only be traversed in one direction, in a forward direction.

Operations on singly linked list

 Insert
- Insert at first position
- Insert at last position
- Insert into ordered list
 Delete
 Traverse list (Print list)
 Copy linked list

1. pg. 39
Data Structure (3130702) 220210107042

3.1 Write a menu driven program to implement following operations on the singly linked
list.
(a) Insert a node at the front of the linked list.
(b) Insert a node at the end of the linked list.
(c) Insert a node such that linked list is in ascending order.(According to INFO field)
(d) Delete a first node of the linked list.
(e) Delete a node before specified position.
(f) Delete a node after specified position.

Program:

#include <stdio.h>
#include <stdlib.h>

struct Node
{
int data;
struct Node *next;
} *head;

void insertAtBeginning()
{
struct Node *newNode = (struct Node *)malloc(sizeof(struct Node));
if (newNode == NULL)
{
printf("Memory allocation failed.\n");
return;
}
printf("Enter the data: ");
scanf("%d", &newNode->data);
newNode->next = NULL;
if (head == NULL)
{
head = newNode;
}
else
{
newNode->next = head;
head = newNode;
}
}

void insertAtEnd()
{
struct Node *current = head;

1. pg. 40
Data Structure (3130702) 220210107042
struct Node *newNode = (struct Node *)malloc(sizeof(struct Node));
if (newNode == NULL)
{
printf("Memory allocation failed.\n");
return;
}
printf("Enter the data: ");
scanf("%d", &newNode->data);
newNode->next = NULL;
if (head == NULL)
{
head = newNode;
}
else
{
while (current->next != NULL)
{
current = current->next;
}
current->next = newNode;
}
}

void insertAscending(int value)


{
struct Node *current = head;
struct Node *newNode = (struct Node *)malloc(sizeof(struct Node));
if (newNode == NULL)
{
printf("Memory allocation failed.\n");
return;
}
printf("Enter the data: ");
scanf("%d", &newNode->data);
newNode->next = NULL;
if (head == NULL)
{
head = newNode;
}
else
{
while (current->next != NULL && current->next->data <= newNode->data)
{
current = current->next;
}

newNode->next = current->next;
1. pg. 41
Data Structure (3130702) 220210107042
current->next = newNode;
}
}

void deleteFirst()
{
struct Node *temp = head;
if (head == NULL)
{
printf("Linked list is empty\n");
}
else
{
head = head->next;
free(temp);
}
}

void deleteBefore(int value)


{
struct Node *temp, *prev;
if (head == NULL)
{
printf("Linked list is empty\n");
return;
}
else if (head->next == NULL)
{
printf("Cannot delete node, only one node\n");
return;
}
else if (head->next->data == value)
{
temp = head;
head = head->next;
free(temp);
return;
}
else
{
prev = head;
temp = head->next;
if (temp->data == value)
{

temp = head;
head = head->next;
1. pg. 42
Data Structure (3130702) 220210107042
free(prev);
free(temp);
return;
}
else
{
while (temp->next != NULL && temp->next->data != value)
{
prev = temp;
temp = temp->next;
}
if (temp->next->data == value)
{
prev->next = temp->next;
free(temp);
return;
}
else
{
printf("%d not found", value);
return;
}
}
}
}

void deleteAfter(int value)


{
struct Node *current = head;
struct Node *temp;
if (head == NULL)
{
printf("Linked list is empty\n");
}
else if (current->data == value)
{
temp = current->next;
current->next = temp->next;
free(temp);
}
else
{
while (current->next != NULL && current->next->data != value)

{
current = current->next;
}
1. pg. 43
Data Structure (3130702) 220210107042
if (current->next->data == value)
{
temp = current->next;
temp = temp->next;
current->next = temp;
free(temp);
}
else
{
printf("%d not found", value);
return;
}
}
}

void display()
{
struct Node *current = head;
if (head == NULL)
{
printf("Linked list is empty\n");
}
else
{
printf("Linked List: ");
while (current != NULL)
{
printf("%d ", current->data);
current = current->next;
}
printf("\n");
}
}

int main()
{
int choice;
do
{
printf("1. Insert at the beginning\n");
printf("2. Insert at the end\n");
printf("3. Insert in ascending order\n");

printf("4. Delete the first node\n");


printf("5. Delete the node before specified node\n");
printf("6. Delete the node after specified node\n");
printf("7. Display the linked list\n");
1. pg. 44
Data Structure (3130702) 220210107042
printf("0. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
int x, y;
switch (choice)
{
case 1:
insertAtBeginning();
break;
case 2:
insertAtEnd();
break;
case 3:
insertAscending(x);
break;
case 4:
deleteFirst();
break;
case 5:
printf("Enter data: ");
scanf("%d", &x);
deleteBefore(x);
break;
case 6:
printf("Enter data: ");
scanf("%d", &y);
deleteAfter(y);
break;
case 7:
display();
break;
case 0:
printf("Exit!\n");
return 0;
default:
printf("Invalid choice.\n");
}
} while (choice != 0);
return 0;
}

Output:

1. Insert at the beginning


2. Insert at the end
3. Insert in ascending order
1. pg. 45
Data Structure (3130702) 220210107042
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 1
Enter the data: 98
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 1
Enter the data: 63
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 1
Enter the data: 57
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 7
Linked List: 57 63 98
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 4
1. Insert at the beginning
1. pg. 46
Data Structure (3130702) 220210107042
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 7
Linked List: 63 98
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 5
Enter data: 98
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 7
Linked List: 98
1. Insert at the beginning
2. Insert at the end
3. Insert in ascending order
4. Delete the first node
5. Delete the node before specified node
6. Delete the node after specified node
7. Display the linked list
0. Exit
Enter your choice: 0
Exit!

3.2 Write a program to implement stack using linked list

Program:

#include <stdio.h>
#include <stdlib.h>

1. pg. 47
Data Structure (3130702) 220210107042
struct Node
{
int data;
struct Node* next;
};

struct Node* top = NULL;

void push(int value)


{
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
if (newNode == NULL)
{
printf("Error: Memory allocation failed\n");
return;
}
newNode->data = value;
newNode->next = top;
top = newNode;
}

void pop()
{
if (top == NULL)
{
printf("Error: Stack is empty\n");
return;
}
struct Node* temp = top;
top = top->next;
free(temp);
}

void display()
{
if (top == NULL)
{
printf("Stack is empty\n");
return;

}
struct Node* temp = top;
printf("Stack elements: ");
while (temp != NULL)
{
printf("%d ", temp->data);
temp = temp->next;
1. pg. 48
Data Structure (3130702) 220210107042
}
printf("\n");
}

int main()
{
int choice, value;
do
{
printf("1. Push\n");
printf("2. Pop\n");
printf("3. Display\n");
printf("0. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice)
{
case 1:
printf("Enter the element to push: ");
scanf("%d", &value);
push(value);
break;
case 2:
pop();
break;
case 3:
display();
break;
case 0:
printf("Exiting the program. Goodbye!\n");
break;
default:
printf("Exit!!\n");
}
} while (choice != 0);
return 0;
}

Output:

1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter the element to push: 95
1. pg. 49
Data Structure (3130702) 220210107042
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter the element to push: 53
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter the element to push: 42
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 3
Stack elements: 42 53 95
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 2
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 2
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 3
Stack elements: 95
1. Push
2. Pop
3. Display

0. Exit
Enter your choice: 0
Exit!!

1. pg. 50
Data Structure (3130702) 220210107042

3.3 Write a program to implement queue using linked list.

Program:

#include <stdio.h>
#include <stdlib.h>

struct Node
{
int data;
struct Node *next;
};

struct Node *head = NULL;

void push()
{
struct Node *newNode = (struct Node *)malloc(sizeof(struct Node));
if (newNode == NULL)
{
printf("Memory allocation failed.\n");
return;
}
printf("Enter element to push: ");
scanf("%d", &newNode->data);
newNode->next = head;
head = newNode;
}

void pop()
{
if (head == NULL)
{
printf("Stack is empty.\n");
return;
}
struct Node *temp = head;
head = head->next;
free(temp);
}

void display()
{
struct Node *current = head;
if (current == NULL)
1. pg. 51
Data Structure (3130702) 220210107042

{
printf("Stack is empty.\n");
return;
}
printf("Stack: ");
while (current != NULL)
{
printf("%d ", current->data);
current = current->next;
}
printf("\n");
}

int main()
{
int choice;
do
{
printf("1. Push\n");
printf("2. Pop\n");
printf("3. Display\n");
printf("0. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice)
{
case 1:
push();
break;
case 2:
pop();
break;
case 3:
display();
break;
case 0:
printf("Exit!!");
break;
default:
printf("Invalid choice.\n");
}
} while (choice != 0);

return 0;
}
1. pg. 52
Data Structure (3130702) 220210107042

Output:

1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter element to push: 55
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter element to push: 99
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 1
Enter element to push: 78
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 3
Stack: 78 99 55
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 2
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 3
Stack: 99 55
1. Push
2. Pop
3. Display
0. Exit
Enter your choice: 0
Exit!!

1. pg. 53
Data Structure (3130702) 220210107042
Observations:

linked lists serve as dynamic data structures well-suited for scenarios where the number of
elements is uncertain or subject to frequent changes. They form the basis for essential data
structures such as stacks and queues. By understanding and mastering linked lists, programmers
gain a foundational skillset crucial for various applications and problem-solving tasks in computer
science.

Conclusion:

while a singly linked list offers a straightforward and memory-efficient data structure
where each node points to the next in line, it is constrained by its unidirectional traversal nature,
restricting movement solely from the head to the tail. While this simplicity and memory efficiency
are noteworthy advantages, it encounters challenges, particularly in scenarios necessitating
reverse traversal. The inherent limitations of singly linked lists become evident when operations
demand navigating the list in the opposite direction, highlighting the need for alternative data
structures in such cases.

Quiz:
(1) Which are the operations on singly link list?
- Insertion
- Deletion
- Update

(2) State the limitation of singly link list


Singly linked lists lack backward traversal efficiency due to their one-way pointers,
contrasting with double linked lists. Reversing them demands additional time and
space, making it inefficient, particularly in memory constraints.

(3) Compare array and singly link list


Arrays offer contiguous memory storage, allowing quick access via indices, but
their size is fixed. Singly linked lists use non-contiguous memory, enabling
dynamic size adjustments, though accessing elements requires traversing the list,
making it slower than arrays. Arrays excel in random access, while linked lists are
efficient for dynamic data.

Suggested Reference:

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G.


Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prenctice-Hall International
3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 2001 ed.
4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms/

References used by the students:


1. pg. 54
Data Structure (3130702) 220210107042

http://www.geeksforgeeks.org/data-structures/

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 55
Data Structure (3130702) 220210107042
Experiment No: 4

AIM : Doubly linked list

4.1 Write a program to implement following operations on the doubly linked list.
(a) Insert a node at the front of the linked list.
(b) Insert a node at the end of the linked list.
(c) Delete a last node of the linked list.
(d) Delete a node before specified position.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO2, CO5

Objectives: (a) To understand the concepts of doubly linked list


(b) To analyze different algorithms on doubly link list
(c) To implement various operations on doubly link list

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Doubly linked list

A doubly linked list is a data structure where each node contains data and two pointers - one to
point to the previous node (LPTR) and another to point to the next node (RPTR). The main
advantage of a doubly linked list is that we can traverse it in any direction, either forward or
backward. Another advantage is that we can delete a node with ease since we have pointers to
both the previous and next nodes. In contrast, a node on a singly linked list cannot be removed
unless we have a pointer to its predecessor. However, the drawback of a doubly linked list is that
it requires more memory than a singly linked list since we need an extra pointer to point to the
previous node. In the image, L and R denote the leftmost and rightmost nodes in the list,
respectively. The left link of the L node and the right link of the R node are both NULL,
indicating the end of the list for each direction.

Operations on doubly linked list

 Insert
- Insert at first position
- Insert at last position

1. pg. 56
Data Structure (3130702) 220210107042
- Insert into ordered list
 Delete
 Traverse list (Print list)
 Copy linked list

1. pg. 57
Data Structure (3130702) 220210107042

4.1 Write a program to implement following operations on the doubly linked list.
(a) Insert a node at the front of the linked list.
(b) Insert a node at the end of the linked list.
(c) Delete a last node of the linked list.
(d) Delete a node before specified position.

Program:
#include<stdio.h>
#include<stdlib.h>

struct node
{
int data;
struct node *next;
struct node *prev;
};

struct node *head;


struct node *tail;
struct node *temp;

// (A)Insert a node at the front of the linked list.


void insertbeg()
{
struct node *nn = malloc(sizeof(struct node));
if (nn == NULL)
{
printf("Memory not allocated");
return;
}

printf("Enter data: ");


scanf("%d", &nn->data);
nn->prev = NULL;
nn->next = NULL;

if(head == NULL)
{
head = nn;
}
else
{
nn->next = head;
head->prev = nn;
head = nn;
}
}

1. pg. 58
Data Structure (3130702) 220210107042

// (B)Insert a node at the end of the linked list.


void insertend()
{
struct node *cur = head;
struct node *nn = (struct node *)malloc(sizeof(struct node));
if (nn == NULL)
{
printf("Memory not allocated");
return;
}

printf("Enter data: ");


scanf("%d", &nn->data);
nn->prev = NULL;
nn->next = NULL;

if (head == NULL)
{
head = nn;
}
else
{
while (cur->next != NULL)
{
cur = cur->next;
}
nn->prev = cur;
cur->next = nn;
}
}

// (C)Delete a last node of the linked list.


void deleteend()
{
if (head == NULL)
{
printf("Link list is empty\n");
return;
}
struct node *p = head;
struct node *temp = head->next;
if (temp == NULL)
{
head = NULL;
free(p);
return;
}
else
{
while (temp->next != NULL)
1. pg. 59
Data Structure (3130702) 220210107042

{
p = temp;

temp = temp->next;
}
p->next = NULL;
free(temp);
return;
}
}

// (D)Delete a node before specified position


void deletebsn()
{
struct node *temp, *p;
int d;
if (head == NULL)
{
printf("Linked list is empty\n");
return;
}
else if (head->next == NULL)
{
printf("Can not delete node only one node\n");
return;
}
printf("Enter data:");
scanf("%d", &d);
if (head->data == d)
{
printf("This is first node\n");
free(p);
free(temp);
return;
}
else
{
p = head;
temp = head->next;
if (temp->data == d)
{
temp = head;
head = head->next;
free(p);
free(temp);
return;
}
else
{
while (temp->next != NULL && temp->next->data != d)
1. pg. 60
Data Structure (3130702) 220210107042

{
p = temp;
temp = temp->next;

}
if(temp->next == NULL)
{
printf("%d Not found!!\n", d);
return;
}
if (temp->next->data == d)
{
p->next = temp->next;
temp->next->prev = temp->prev;
free(temp);
return;
}
}
}
}

int main()
{
int choice;
head = NULL;

do
{
printf("\n1. Insert at the beginning\n");
printf("2. Insert at the end\n");
printf("3. Delete at the end\n");
printf("4. Delete before specified position\n");
printf("5. Display\n");
printf("6. Exit\n");

printf("Enter your choice: ");


scanf("%d", &choice);

switch (choice)
{
case 1:
insertbeg();
break;
case 2:
insertend();
break;
case 3:
deleteend();
break;
case 4:
1. pg. 61
Data Structure (3130702) 220210107042

deletebsn();
break;
case 5:
temp = head;

while (temp != NULL)


{
printf("%d ", temp->data);
temp = temp->next;
}
printf("NULL\n");
break;
case 6:
printf("Exiting the program.\n");
break;
default:
printf("Invalid choice! Please enter a valid option.\n");
}

} while (choice != 6);

return 0;
}

Output :
1. Insert at the beginning
2. Insert at the end
3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 1
Enter data: 45

1. Insert at the beginning


2. Insert at the end
3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 1
Enter data: 99

1. Insert at the beginning


2. Insert at the end
3. Delete at the end
4. Delete before specified position

1. pg. 62
Data Structure (3130702) 220210107042
5. Display
6. Exit
Enter your choice: 3

1. Insert at the beginning

2. Insert at the end


3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 1
Enter data: 36

1. Insert at the beginning


2. Insert at the end
3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 5
36 99

1. Insert at the beginning


2. Insert at the end
3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 2
Enter data: 200

1. Insert at the beginning


2. Insert at the end
3. Delete at the end
4. Delete before specified position
5. Display
6. Exit
Enter your choice: 6
Exiting the program.

Observations:
A doubly linked list is a linear data structure with nodes containing a
value and two pointers: one pointing to the next node and another to the
previous node. This bidirectional linkage allows for efficient traversal in both
forward and backward directions.

1. pg. 63
Data Structure (3130702) 220210107042

Conclusion:
In conclusion, the provided C code establishes a doubly linked list,
offering enhanced traversal capabilities with bidirectional pointers. The
structure allows seamless navigation both forward, from head to tail, and
backward, from tail to head. Despite the added versatility for various
operations, it's important to note that doubly linked lists consume slightly
more memory
than singly linked li

Quiz:
(1) Explain structure of a node of doubly link list
(2) Which is the main advantage of doubly link list?
(3) What is the drawback of doubly link list?
Ans:
(1) A node in a doubly linked list consists of a value and two pointers: one pointing to the next
node and another to the previous node. This bidirectional linkage allows for flexible traversal
in both forward and backward directions.
(2) The main advantage of a doubly linked list is its bidirectional linkage, enabling
efficient traversal in both forward and backward directions.
(3) The drawback of a doubly linked list is that it consumes slightly more memory
compared to a singly linked list due to the additional pointer for the previous node.

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 64
Data Structure (3130702) 220210107042
Experiment No: 5

AIM : Circular linked list

5.1 Write a program to implement following operations on the circular linked list.
(a) Insert a node at the end of the linked list.
(b) Insert a node before specified position.
(c) Delete a first node of the linked list.
(d) Delete a node after specified position.
5.2 Identify widely used application which uses linked list for implementation of its
important feature.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO2, CO5

Objectives: (a) To understand the concepts of circular linked list


(b) To analyze different algorithms on circular link list
(c) To implement various operations on circular link list

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Circular linked list

A circular linked list is similar to a singly linked list, except that the last node points to the first
node, creating a circular arrangement of nodes. Unlike a singly linked list, it does not contain null
pointers. Traversal can only be done in one direction, i.e., the forward direction. The biggest
advantage of a circular linked list is that it saves time when we want to go from the last node to
the first node because it directly points to the first node. A good example of an application where
a circular linked list can be used is a time-sharing problem that can be solved by the operating
system.

Operations on circular linked list

 Insert
- Insert at first position
- Insert at last position
1. pg. 65
Data Structure (3130702) 220210107042
- Insert into ordered list
 Delete
 Traverse list (Print list)

1. pg. 66
Data Structure (3130702) 220210107042

5.1 Write a program to implement following operations on the circular linked list.
(a) Insert a node at the end of the linked list.
(b) Insert a node before specified position.
(c) Delete a first node of the linked list.
(d) Delete a node after specified position.

Program:

#include<stdio.h>
#include<stdlib.h>

struct node
{
int data;
struct node *next;
struct node *prev;
};

struct node *h = NULL;


struct node *t = NULL;
struct node *cur = NULL;

// (A) Insert a node at the end of the linked list.


void insertend() {
struct node *nn = (struct node *)malloc(sizeof(struct node));
if (nn == NULL) {
printf("Memory not allocated !!");
return;
}
printf("Enter the data: ");
scanf("%d", &nn->data);
nn->next = h;
if (h == NULL) {
h = nn;
t = nn;
return;
} else {
nn->next = h;
t->next = nn;
t = nn;
return;
}
}

1. pg. 67
Data Structure (3130702) 220210107042
// (B) Insert a node before specified position.
void insertbsn(int d) {
if (h == NULL) {
printf("--> Link list is empty\n");
return;
}
struct node *prev;
struct node *cur = h;
struct node *nn = (struct node *)malloc(sizeof(struct node));
if (nn == NULL) {
printf("Memory not allocated !!");
return;
}
if (h->data == d) {
printf("Enter the data: ");
scanf("%d", &nn->data);
nn->next = h;
h = nn;
t->next = h;
return;
}
if (h == t && h->data != d) {
printf("Node not found\n");
return;
} else {
while (cur->next != h && cur->data != d) {
prev = cur;
cur = cur->next;
}
if (cur == t && cur->data != d) {
printf("Node not found\n");
return;
}
if (cur->data == d && cur != t) {
printf("Enter the data: ");
scanf("%d", &nn->data);
prev->next = nn;
nn->next = cur;
return;
}
if (cur->data == d && cur == t) {
printf("Enter the data: ");
scanf("%d", &nn->data);
prev->next = nn;
nn->next = cur;

t = cur;
1. pg. 68
Data Structure (3130702) 220210107042
t->next = h;
return;
}
}
}

// (C) Delete a first node of the linked list.


void deletebeg() {
struct node *temp;
if (h == NULL) {
printf("Link list is empty\n");
return;
} else if (h->next == t) {
temp = h;
h = h->next;
t = h;
h->next = NULL;
free(temp);
} else {
temp = h;
h = h->next;
t->next = h;
free(temp);
return;
}
}

// (D) Delete a node after specified position.


void deleteasn(int v) {
struct node *cur = h;
struct node *temp;
if (h == NULL) {
printf("Link list is empty\n");
return;
} else {
while (cur != t && cur->data != v) {
cur = cur->next;
}
if (cur == t && cur->data != v) {
printf("Node not found\n");
return;
}
if (cur == t && cur->data == v) {
printf("an not delete after last node\n");

return;
}
1. pg. 69
Data Structure (3130702) 220210107042
if (cur->next == t && cur->data == v) {
temp = t;
t = cur;
t->next = h;
free(temp);
} else {
temp = cur->next;
cur->next = temp->next;
free(temp);
return;
}
}
}

int main() {
int choice, data, position;

do {
printf("\n1. Insert at the end\n");
printf("2. Insert before specified position\n");
printf("3. Delete first node\n");
printf("4. Delete node after specified position\n");
printf("5. Display\n");
printf("6. Exit\n");

printf("Enter your choice: ");


scanf("%d", &choice);

switch (choice) {
case 1:
insertend();
break;
case 2:
printf("Enter the data before which you want to insert: ");
scanf("%d", &data);
insertbsn(data);
break;
case 3:
deletebeg();
break;
case 4:
printf("Enter the data after which you want to delete: ");
scanf("%d", &data);

deleteasn(data);
break;
case 5:
1. pg. 70
Data Structure (3130702) 220210107042
cur = h;
if (cur == NULL) {
printf("Circular linked list is empty.\n");
} else {
printf("Circular linked list: ");
do {
printf("%d ", cur->data);
cur = cur->next;
} while (cur != h);
}
break;
case 6:
printf("Exiting the program.\n");
break;
default:
printf("Invalid choice! Please enter a valid option.\n");
}
} while (choice != 6);

return 0;
}

Output:
1. Insert at the end
2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 1
Enter the data: 78

1. Insert at the end


2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 1
Enter the data: 93

1. Insert at the end

2. Insert before specified position


3. Delete first node
4. Delete node after specified position
5. Display
1. pg. 71
Data Structure (3130702) 220210107042
6. Exit
Enter your choice: 1
Enter the data: 11

1. Insert at the end


2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 5
Circular linked list: 78 93 11

1. Insert at the end


2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 3

1. Insert at the end


2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 3

1. Insert at the end


2. Insert before specified position
3. Delete first node
4. Delete node after specified position
5. Display
6. Exit
Enter your choice: 5
Circular linked list: 11

1. pg. 72
Data Structure (3130702) 220210107042

5.2 Identify widely used application which uses linked list for implementation of its
important feature.

Memory Management in Operating Systems:


Linked lists efficiently manage free memory blocks, aiding memory allocation and
deallocation in operating systems.

Music Playlist Management:


Music players use linked lists to handle dynamic playlist arrangements, allowing for easy
song insertion, deletion, and reordering.

Symbol Table in Compilers:


Compilers utilize linked lists for symbol tables, facilitating the storage and manipulation of
variable and function information during the compilation process.

Observations:
A circular linked list is a linear data structure where each node has a value and a pointer to
the next node. It employs two extra pointers, head (pointing to the first element) and tail (pointing
to the last). The circularity is achieved by having the tail's next pointer point to the head. This
structure facilitates efficient traversal and manipulation of the entire list.

Conclusion:
In normal link list we cannot use free space available in link list but, we can use free space
in circular link list to store new nodes. That is why circular link list is space efficient. The tail
pointer of circular link list has address of head which makes link list a circular one.

Quiz:
(1) What are disadvantages of circular link list?
(2) Differentiate Circular link list and Queue
(3) Which are the operations on circular link list?
Ans:
(1) Disadvantages of Circular Linked List:
Increased Complexity: Operations like traversal and insertion become more complex due
to circularity.
Extra Memory Overhead: Maintaining two additional pointers (head and tail) increases
memory overhead.
Infinite Loop Possibility: A mistake in updating pointers can lead to an infinite loop during
traversal.

(2) Circular Linked List vs. Queue


Circular Linked List:
Generic linear data structure with a circular connection.
Supports various operations beyond typical queue functionality.
Not inherently designed for specific queue characteristics.
Queue:
Abstract data type designed for a first-in, first-out (FIFO) order.
1. pg. 73
Data Structure (3130702) 220210107042
Enforces a strict order for insertion and deletion.
Circular queues can be implemented using a circular linked list.

(3) Operations on Circular Linked List:


Insertion:
Insert at the beginning.
Insert at the end.
Insert before a specified position.
Deletion:
Delete the first node.
Delete a specified node.
Delete the last node.
Traversal:
Traverse and display the elements of the circular linked list.

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 74
Data Structure (3130702) 220210107042
Experiment No: 6

AIM : Tree

6.1 Write a program which create binary search tree.


6.2 Implement recursive tree traversing methods in-order, pre-order and post-order
traversal.
6.3 Identify widely used applications which use Tree data structure for implementation
of its important feature.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO3, CO5

Objectives: (a) To understand the concepts of Tree


(b) To analyze different algorithms on Tree
(c) To implement various operations on Tree

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Binary Search Tree

A binary search tree is a binary tree in which each node possessed a key that satisfy the
following conditions

1. All key (if any) in the left sub tree of the root precedes the key in the root.
2. The key in the root precedes all key (if any) in the right sub tree.
3. The left and right sub tree sub trees of the root are again search trees.

Operations on tree

The most common operations performed on tree structure are that of traversal. This is a procedure
by which each node in the tree is processed exactly once in a systematic manner.

There are three ways of traversing a binary tree.

1. Pre-order Traversal

1. pg. 75
Data Structure (3130702) 220210107042
2. In-order Traversal
3. Post-order Traversal
Pre-order

 Pre-order traversal of a binary tree is defined as follow


 Process the root node
 Traverse the left sub tree in pre-order
 Traverse the right sub tree in pre-order
 If particular sub tree is empty (i.e., node has no left or right descendant) the traversal is
performed by doing nothing, In other words, a null sub tree is considered to be fully
traversed when it is encountered.

In-order

 The In-order traversal of a binary tree is given by following steps,


 Traverse the left sub tree in In-order
 Process the root node
 Traverse the right sub tree in In-order

Post-order

 The post-order traversal is given by


 Traverse the left sub tree in post-order
 Traverse the right sub tree in post-order
 Process the root node

1. pg. 76
Data Structure (3130702) 220210107042

6.1 Write a program which create binary search tree.


6.2 Implement recursive tree traversing methods in-order, pre-order and post-order
traversal.

Program:
#include<stdio.h>
#include<stdlib.h>

struct vertex
{
int data;
struct vertex *l;
struct vertex *r;
};

// (A) Write a program to create a binary search tree.


void createbst(struct vertex **cur_root, struct vertex *new_vertex)
{
if (*cur_root == NULL)
{
*cur_root = new_vertex;
return;
}

if ((*cur_root)->data <= new_vertex->data)


{
if ((*cur_root)->r == NULL)
{
(*cur_root)->r = new_vertex;
}
else
{
createbst(&((*cur_root)->r), new_vertex);
}
}
else
{
if ((*cur_root)->l == NULL)
{
(*cur_root)->l = new_vertex;
}
else
{
createbst(&((*cur_root)->l), new_vertex);
}
}
1. pg. 77
Data Structure (3130702) 220210107042
}

// (B) Implement recursive tree traversing methods: in-order, pre-order, and post-order traversal.
void inorder(struct vertex *root)
{
if (root != NULL)
{
inorder(root->l);
printf("%d ", root->data);
inorder(root->r);
}
}

void preorder(struct vertex *root)


{
if (root != NULL)
{
printf("%d ", root->data);
preorder(root->l);
preorder(root->r);
}
}

void postorder(struct vertex *root)


{
if (root != NULL)
{
postorder(root->l);
postorder(root->r);
printf("%d ", root->data);
}
}
struct vertex *createVertex(int data) {
struct vertex *newVertex = (struct vertex *)malloc(sizeof(struct vertex));
if (newVertex == NULL) {
printf("Memory allocation failed.\n");
return 1;
}
newVertex->data = data;
newVertex->l = NULL;
newVertex->r = NULL;
return newVertex;
}

int main()
{
1. pg. 78
Data Structure (3130702) 220210107042
struct vertex *root = NULL; // Initialize the root of the binary search tree

int choice;
do {
printf("\n0. Stop\n");
printf("1. Create\n");
printf("2. Inorder\n");
printf("3. Preorder\n");
printf("4. Postorder\n");

printf("Enter your choice: ");


scanf("%d", &choice);

switch (choice) {
case 0:
printf("Stopping the program.\n");
break;
case 1: {
int data;
printf("Enter data for the new node: ");
scanf("%d", &data);
createbst(&root, createVertex(data));
printf("Node with data %d added to the binary search tree.\n", data);
break;
}
case 2:
printf("In-order traversal: ");
inorder(root);
printf("\n");
break;
case 3:
printf("Pre-order traversal: ");
preorder(root);
printf("\n");
break;
case 4:
printf("Post-order traversal: ");
postorder(root);
printf("\n");
break;
default:
printf("Invalid choice! Please enter a valid option.\n");
}
} while (choice != 0);

return 0;
}
1. pg. 79
Data Structure (3130702) 220210107042

Output:
0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 1
Enter data for the new node: 55
Node with data 55 added to the binary search tree.

0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 1
Enter data for the new node: 99
Node with data 99 added to the binary search tree.

0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 1
Enter data for the new node: 33
Node with data 33 added to the binary search tree.

0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 2
In-order traversal: 33 55 99

0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 3
Pre-order traversal: 55 33 99

0. Stop
1. Create
1. pg. 80
Data Structure (3130702) 220210107042
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 4
Post-order traversal: 33 99 55

0. Stop
1. Create
2. Inorder
3. Preorder
4. Postorder
Enter your choice: 0
Stopping the program.

1. pg. 81
Data Structure (3130702) 220210107042

6.3 Identify widely used applications which use Tree data structure for implementation
of its important feature.
File Systems:
File systems, such as the hierarchical file system in operating systems (e.g., NTFS, HFS+,
Ext4), are often implemented using tree structures. Directories and files form a tree hierarchy
for easy navigation and organization.

Database Management Systems (DBMS):


Database indexing uses tree structures, such as B-trees and B+ trees, to speed up the retrieval
of records. These trees provide efficient search, insertion, and deletion operations.

Web Browsers - Document Object Model (DOM):


The DOM structure used by web browsers to represent HTML or XML documents is often
implemented as a tree. Each HTML element becomes a node in the tree, allowing for efficient
traversal and manipulation.

Observations:
Trees, dynamic and hierarchical, adapt to changing needs at runtime, making them ideal for
flexible data organization. As an abstract structure, trees facilitate hierarchical arrangement and
serve as a foundation for implementing various data structures and algorithms, including heaps
and search trees.

Conclusion:
In tree data structure there are three fields one have data and other two are pointer in which first one points
to left child of the node and other one points to right child of the node. Initially root is NULL. There are
mainly three traversal in tree:

1. Inorder: In inorder traversal it travel first left subtree of root then root and lastly right subtree of root.
2. Preorder: In preorder traversal it travel first root then left subtree of root and lastly right subtree of
root.

3. Postorder: In postorder traversal it travel first left subtree of root then right subtree of root and lastly
the root.

Quiz:
(1) Define binary search tree
(2) Explain pre-order, in-order and post order traversal techniques
(3) Which are the applications of binary search tree?

Ans:
(1) A binary search tree is a binary tree data structure in which each node has at most two
children, typically arranged such that nodes to the left are smaller, and nodes to the right
are greater than the parent node. This property allows for efficient searching, insertion, and
deletion of elements, making BSTs a valuable data structure for tasks like sorting and

1. pg. 82
Data Structure (3130702) 220210107042
searching.

(2) Pre-order Traversal: In this binary tree traversal technique, the current node is visited first,
then its left child is traversed, followed by the right child. Pre-order is useful for creating a
copy of the tree or when dealing with hierarchical structures. In-order Traversal: This
traversal explores the left child, then the current node, and finally the right child. In binary
search trees, an in-order traversal results in nodes being visited in ascending order. It's
commonly used for searching and sorting tasks. Post-order Traversal: In this approach, the
left child is visited, then the right child, and finally the current node. Post-order is useful
for tasks like deleting nodes and releasing resources, as it ensures child nodes are
processed before their parent.

(3) Data Retrieval: Efficient searching, insertion, and deletion operations. Sorting: In-order
traversal produces sorted data. File Systems: Represent directory structures. Symbol
Tables: Used in compilers, interpreters, and dictionaries. Priority Queues: Supports
efficient priority-based operations. Balanced Trees: AVL and Red-Black trees for self-
balancing. Caching: Least Recently Used cache management. Game Development:
Hierarchical game object organization.

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 83
Data Structure (3130702) 220210107042

Experiment No: 7

AIM : Graph

7.1 Write a program to perform BFS and DFS on given graph.


7.2 Identify widely used applications which use graphs data structure for implementation
of its important feature.

Date:

Competency and Practical Skills: Logic building and programming

Relevant CO: CO3, CO5

Objectives: (a) To understand the concepts of graphs


(b) To analyze different algorithms on graphs
(c) To implement various operations on graphs

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Graph:

A graph G can be defined as a non-empty set of vertices or nodes (V) and a set of edges (E) that
represents the relationship or connection between those nodes. The edges can be defined as a
mapping from E to pairs of elements of V. A graph can be represented as G = (V, E), where V
represents the set of nodes and E represents the set of edges. Each edge of the graph G can be
associated with a pair of nodes of the graph. If an edge X belongs to E and is associated with a
pair of nodes (u, v), where u and v belong to V, then we say that edge X connects node u and node
v.

Depth First Search (DFS):

DFS is a graph traversal algorithm that is similar to the preorder traversal of a tree. The traversal
can start from any vertex vi of the graph. Initially, the vertex vi is visited, and then all the adjacent
vertices to vi are traversed recursively using DFS. As a graph can have cycles, we need to avoid
revisiting a node. To achieve this, when a vertex V is visited, it is marked as visited and should
not be selected for traversal again.

1. pg. 84
Data Structure (3130702) 220210107042

Breadth First Search (BFS)

 Breadth First Search (BFS) starts from a vertex v0 and marks it as visited. Then, all the
vertices adjacent to v0 are visited next.
 Let the vertices adjacent to v0 be v1, v2, v3, and v4. These vertices are marked as visited.
 All unvisited vertices adjacent to v1, v2, v3, and v4 are visited next.
 The above process continues until all vertices are visited.
 The algorithm for BFS maintains a list of vertices that have been visited but not explored
for adjacent vertices. This list is stored in a queue.
 The queue initially contains the starting vertex.
 In each iteration, a vertex is removed from the queue, and its adjacent vertices, which have
not been visited yet, are added to the queue.
 The algorithm terminates when the queue becomes empty.

1. pg. 85
Data Structure (3130702) 220210107042

7.1 Write a program to perform BFS and DFS on given graph.

Program:

#include <stdio.h>
#define size 40

int stack[size];
int q[size];
int top = -1;
int h = -1, t = -1;

int isfull() {
if (top == size - 1)
return 1;
else
return 0;
}

int isempty() {
if (top == -1)
return 1;
else
return 0;
}

void push(int x) {
if (isfull()) {
printf("Stack is full\n");
} else {
stack[++top] = x;
}
}

int pop() {
if (isempty()) {
printf("Stack is empty\n");
return -1;
} else {
return stack[top--];
}
}

void enque(int n) {
if (t == size - 1) {
printf("Queue overflow\n");
1. pg. 86
Data Structure (3130702) 220210107042
} else {
if (h == -1) {
h = 0;
}
q[++t] = n;
}
}

int deque() {
if (h == -1) {
printf("Queue underflow\n");
return -1;
} else {
int item = q[h++];
if (h > t) {
h = -1;
t = -1;
}
return item;
}
}

int main() {
int n, x, i, j, c, count = 0;
printf("\n1.DFS 2.BFS\n");
printf("enter choice accordingly:");
scanf("%d", &c);
printf("enter number of element:");
scanf("%d", &n);

int matrix[n][n];
int visited[n];

printf("Enter matrix:");
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
scanf("%d", &matrix[i][j]);
}
}
for (i = 0; i < n; i++) {
visited[i] = 0;
}

switch (c) {
case 1:
push(0);
printf("\n DFS:");
1. pg. 87
Data Structure (3130702) 220210107042
while (top > -1) {
x = pop();
if (visited[x] == 0) {
visited[x] = 1;
printf("%d ", x);
for (j = n - 1; j >= 0; j--) {
if (matrix[x][j] && visited[j] == 0) {
push(j);
}
}
}
}
break;
case 2:
enque(0);
printf("\n BFS:");
while (h != -1) {
x = deque();
if (visited[x] == 0) {
visited[x] = 1;
printf("%d ", x);
for (j = 0; j < n; j++) {
if (matrix[x][j] && visited[j] == 0) {
enque(j);
}
}
}
}
break;
default:
printf("\n Please enter correctly");
break;
}
return 0;
}

1. pg. 88
Data Structure (3130702) 220210107042

Output:

1.DFS 2.BFS
enter choice accordingly:1
enter number of element:5
Enter matrix:
01100
10011
10001
01000
01100

DFS:0 1 3 4 2

1.DFS 2.BFS
enter choice accordingly:2
enter number of element:4
Enter matrix:
0110
1011
1100
0100

BFS:0 1 2 3

1. pg. 89
Data Structure (3130702) 220210107042

7.2 Identify widely used applications which use graphs data structure for implementation
of its important feature.

Social Networks:
Social networks often model relationships between users as a graph,
where each user is a node, and connections (friendships) between users
are represented as edges. Algorithms based on graph theory are used
to suggest friends, identify clusters of users with common interests, and
analyze the overall network structure. Graphs help in navigating and
understanding the intricate web of social connections.

Google Maps and Navigation Services:


In mapping and navigation applications, graphs are used to represent
road networks. Nodes represent intersections or locations, and edges
represent roads connecting them. Algorithms like Dijkstra's or A* are
employed for finding the shortest path from one location to another.
Additionally, graph structures help in optimizing routes, avoiding traffic
congestion, and providing real-time updates. Google Maps, for instance,
uses graphs to calculate efficient routes for driving, walking, and public
transportation.

Observations:
Graphs are foundational in real-world applications, notably in social
networks and navigation services. Road networks are represented as graphs,
enabling efficient route planning and optimization. Graphs contribute to
optimization, seen in friend suggestions and route planning algorithms.
Graphs serve as versatile tools for addressing connectivity, relationship, and
pathfinding challenges. The observations highlight the adaptability of graph
data structures across diverse applications.

Conclusion:
In conclusion, the observations emphasize the integral role of graph
data structures in diverse applications. From modelling relationships in social
networks to optimizing routes in navigation services, graphs prove to be
versatile problem-solving tools, showcasing their adaptability and
effectiveness in addressing complex challenges.

Quiz:

(1) Define Directed Acyclic Graph (DAG).


(2) Differentiate DFS and BFS.
(3) State the applications of graph.

Ans:
(1) Directed Acyclic Graph (DAG):
1. pg. 90
Data Structure (3130702) 220210107042
A DAG is a graph with directed edges and no cycles, meaning there's no sequence of
vertices where a vertex is reachable from itself.

(2) DFS (Depth-First Search):


Uses a stack, explores as far as possible along each branch before backtracking.

BFS (Breadth-First Search):


Uses a queue, explores neighbors before moving on to the next level.

(3) Applications of Graphs:


- Widely used in social networks for modeling relationships.
- Essential in navigation services for route optimization.
- Applied in recommendation systems, network analysis, and scheduling problems.

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 91
Data Structure (3130702) 220210107042

Experiment No: 8

AIM : Searching

8.1 Write a program to implement Linear Search.


8.2 Write a program to implement Binary Search.
8.3 Identify widely used applications which use Searching technique for implementation
of its important feature.

Date: // Write date of experiment here

Competency and Practical Skills: Logic building and programming

Relevant CO: CO4, CO5

Objectives: (a) To understand the concepts of Searching


(b) To analyze different algorithms on Searching
(c) To implement various operations on Searching

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Linear/Sequential Search

 Linear search, also known as sequential search, is a technique used in computer science to
find a specific value in a list by sequentially checking each of its elements one at a time
until the desired one is found.
 It is the simplest search algorithm and a form of brute-force search. Its worst-case cost is
proportional to the number of elements in the list.

Binary Search

 If we have an array that is sorted, we can use a much more efficient algorithm called
Binary Search.
 In Binary Search, we divide the array into two equal halves and compare the middle
1. pg. 92
Data Structure (3130702) 220210107042
element with the search element.
 If the middle element is equal to the search element, we have found the element and return
its index; otherwise, if the middle element is less than the search element, we look at the
right part of the array, and if the middle element is greater than the search element, we

look at the left part of the array.

8.1 Write a program to implement Linear Search.

Program:

// Write code of your program here

Output:

// Write output of your program here

8.2 Write a program to implement Binary Search.

Program:

// Write code of your program here

Output:

// Write output of your program here

8.3 Identify widely used applications which use Searching technique for implementation
of its important feature.

// Write relevant contents here

Observations:

// Write your observation here

Conclusion:

// Write conclusion here

Quiz:

(1) List out searching algorithms


(2) Differentiate sequential search and binary search
(3) Which are the applications of binary search algorithm?

Suggested Reference:
1. pg. 93
Data Structure (3130702) 220210107042

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul


G. Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prenctice-Hall International
3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 2001 ed.
4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms

References used by the students:

// Write references used by you here

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 94
Data Structure (3130702) 220210107042

Experiment No: 9

AIM : Sorting

9.1 Write a program to implement Quick Sort


9.2 Write a program to implement Merge Sort
9.3 Write a program to implement Bubble Sort
9.4 Identify widely used applications which use Sorting technique for implementation
of its important feature.

Date: // Write date of experiment here

Competency and Practical Skills: Logic building and programming

Relevant CO: CO4, CO5

Objectives: (a) To understand the concepts of Sorting


(b) To analyze different algorithms on Sorting
(c) To implement various operations on Sorting

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Bubble sort

Bubble sort, also known as sinking sort, is a comparison-based sorting algorithm. It works by
repeatedly scanning through the list to be sorted, comparing adjacent elements and swapping them
if they are not in the correct order. In each pass through the list, the largest element bubbles up to
the top. The algorithm repeats these processes until no more swaps are needed, indicating that the
list is sorted. Although it is simple to understand and implement, bubble sort has a worst-case and
average time complexity of O(n^2), making it too slow for large inputs. Insertion sort is a more
efficient alternative for small lists.

Merge Sort

1. pg. 95
Data Structure (3130702) 220210107042
 The merge sort algorithm is based on the classical divide-and-conquer paradigm. It
operates as follows:

 DIVIDE: Partition the n-element sequence to be sorted into two sub sequences of
n/2 elements each.
 CONQUER: Sort the two sub sequences recursively using the merge sort.

 COMBINE: Merge the two sorted sub sequences of size n/2 each to produce the
sorted sequence consisting of n elements.

Quick Sort

Quicksort is currently the fastest known sorting algorithm and often the most practical choice for
sorting, with an average expected running time of O(n log(n)). Its operation consists of the
following steps:
 Pick an element from the array, known as a pivot.
 Reorder the array so that all elements with values less than the pivot are placed before it,
while all elements with values greater than the pivot come after it (elements with equal
values can go either way). This operation is called partitioning, and at the end of it, the
pivot is in its final position.
 Recursively apply the above steps to the sub-arrays of elements with smaller and greater
values, respectively. Quicksort, like merge sort, is a divide-and-conquer recursive
algorithm.
 The basic divide-and-conquer process for sorting a sub array is given in the following
three easy steps:
 Divide
 Conquer
 Combine

9.1 Write a program to implement Quick Sort

Program:

// Write code of your program here

Output:

// Write output of your program here

9.2 Write a program to implement Merge Sort

Program:

// Write code of your program here

Output:

1. pg. 96
Data Structure (3130702) 220210107042
// Write output of your program here

9.3 Write a program to implement Bubble Sort

Program:

// Write code of your program here

Output:

// Write output of your program here

9.4 Identify widely used applications which use Sorting technique for implementation
of its important feature.

// Write relevant contents here

Observations:

// Write your observation here

Conclusion:

// Write conclusion here

Quiz:

(1) Define sorting


(2) What is divide-and-conquer strategy for sorting?
(3) Which is the best suitable sorting algorithm as per its execution time?

Suggested Reference:

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G.


Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prenctice-Hall International
3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 2001 ed.
4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms

References used by the students:

1. pg. 97
Data Structure (3130702) 220210107042
// Write references used by you here

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 98
Data Structure (3130702) 220210107042

Experiment No: 10

AIM : Hashing and File Structure

10.1 Write a program to create hash table and handle the collision using linear probing.
10.2 Write a program to demonstrate the file primitives such as fopen, fclose, fprintf.
10.3 Identify widely used applications which use Hashing technique for implementation of
its important feature.

Date: // Write date of experiment here

Competency and Practical Skills: Logic building and programming

Relevant CO: CO4, CO5

Objectives: (a) To understand the concepts of Hashing techniques


(b) To implement various file operations

Equipment/Instruments: Computer System with turbo C/C++

Safety and necessary Precautions:

 Operate computer system carefully and responsibly.


 Use required lab resources cautiously

Theory:

Hashing

Hashing is a method used to map a large number of data items to a smaller table by utilizing a
hashing function. This technique transforms a range of key values into a range of indexes of an
array.There are two different forms of hashing.

1. Open hashing or external hashing: Open or external hashing, allows records to be


stored in unlimited space (could be a hard disk). It places no limitation on the size of the
tables.
2. Close hashing or internal hashing: Closed or internal hashing, uses a fixed space for
storage and thus limits the size of hash table.

Hashing Functions
1. pg. 99
Data Structure (3130702) 220210107042

Characteristics of a Good Hash Function


 A good hash function avoids collisions.
 A good hash function tends to spread keys evenly in the array.
 A good hash function is easy to compute.

Different hashing functions

1. Division-Method
2. Folding Method
3. Algebraic Coding
4. Multiplicative Hashing
5. Digit Analysis
6. Mid-square Methods
7. Length Dependent Method

Collision Resolution Strategies

 Collision resolution is the main problem in hashing.


 If the element to be inserted is mapped to the same location, where an element is already
inserted then we have a collision and it must be resolved.
 There are several strategies for collision resolution. The most commonly used are :
1. Separate chaining - used with open hashing
2. Open addressing - used with closed hashing

File

In computing, a file is a group of records, where each record comprises one or more fields that
have the same sequence. Typically, each field has a predetermined length.

Different file organizations

1. Sequential files
2. Direct files
3. Index files
4. Indexed Sequential files
5. Relative files

Primitive Operations on a File

1. Creation
2. Insertion
3. Deletion
4. Updation
5. Reading
1. pg. 100
Data Structure (3130702) 220210107042
6. Searching

10.1 Write a program to create hash table and handle the collision using linear probing.

Program:

// Write code of your program here

Output:

// Write output of your program here

10.2 Write a program to demonstrate the file primitives such as fopen, fclose, fprintf.

Program:

// Write code of your program here

Output:

// Write output of your program here

10.3 Identify widely used applications which use Hashing technique for implementation of
its important feature.

// Write relevant contents here

Observations:

// Write your observation here

Conclusion:

// Write conclusion here

Quiz:

(1) What is internal hashing and external hashing?


(2) Explain linear probing.
(3) Which are primitive operations on file?

Suggested Reference:
1. pg. 101
Data Structure (3130702) 220210107042

1. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G.


Sorenson Publisher-Tata McGraw Hill.
2. Data Structures using C & C++ -By Ten Baum Publisher – Prenctice-Hall International
3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 2001 ed.
4. http://www.geeksforgeeks.org/data-structures/
5. http://www.coursera.org/specializations/data-structures-algorithms

References used by the students:

// Write references used by you here

Rubric-wise marks obtained:

Completenes
Problem Coding
Logic s
Rubric Understandin Standards Q&A Tota
Building (2) and accuracy
s g (2) (2) l
(2)
Avg. Good Avg. Good Avg. Goo Avg. Good Avg. Goo
(1) (2) (1) (2) (1) d (2) (1) (2) (1) d (2)

Marks

1. pg. 102

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