FACULTY OF ENGINEERING AND
TECHNOLOGY OF TECHNOLOGY
Design and Analysis of Algorithm Laboratory
(303105219)
5th SEMESTER
ryManual
CERTIFICATE
This is to certify that Mr./Ms. K. Meghana with enrolment no.
2303031460080 and 5th Semester / AIML(Batch-A ) has successfully
completed his/her laboratory experiments in the Artificial Intelligence (303105308)
from the Department of Computer Science & Engineering (AIML) during the academic year
2025-26
Date of Submission: .........................
Head of Department: Staff In charge:
INDEX
SR. Start End Start Date End Date Marks
NO. TITLE Page Page outof Sign
no. no. 10
1 Write a program to determine
whether the given number is
Prime or not.
2 Given a sorted array and a target
value, return the index if the
target is found. If not, return the
index where it would be if
it were inserted in order.
3 There are N children standing in
a line with some rating value.
You want to distribute a
minimum number of candies to
these children such that: Each
child must have at least one
candy. The children with higher
ratings will have more candies
than their neighbours. You need
to write a program to calculate
the minimum candies you must
give.
4 There are N children standing in
a line with some rating value.
You want to distribute a
minimum number of candies to
these children such that: Each
child must have at least one
candy. The children with higher
ratings will have more candies
than their neighbours. You need
to write a program to calculate
the minimum candies you must
give.
5 Given an undirected graph with
V vertices and E edges, check
whether it contains any cycle or
not
6 There are n servers numbered
from 0 to n – 1 connected by
undirected server-to-server
connections forming a network
where connections[i] = [ai, bi]
represents a connection between
servers ai and bi. Any server
can reach other servers
directly or indirectly through
the network. A critical
connection is a connection
that, if removed, will make
some servers unable to reach
some other servers. Return all
critical connections in the
network in any order.
7 Given a grid of size NxM (N
is the number of rows and M
is the number of columns in
the grid) consisting of ‘0’s
(Water) and ‘1’s(Land). Find
the number of islands.
8 Given a grid of dimension N x
M where each cell in the grid
can have values 0, 1, or 2
which has e following
meaning:
0: Empty cell
1: Cells have fres
2. Cells have oranrotten
oranges We have to determine
what is the minimum time
required to rot all oranges. A
rotten orange at index [i,j] can
rot other fresh oranges at
indexes [i-1,j], [i+1,j], [i,j-1],
[i,j+1] (up, down, left and
right) in unit time’
9 Given two strings str1 and str2
and below operations that can
be performed on str1. Find
minimum number of edits
(operations) required to
convert ‘str1’ into ‘str2’.
Insert Remove Replace, All of
the above operations are of
equal cost.
10 Minimum Path Sum” says that
given a n x m grid consisting
of non-negative integers and
we need to find a path from
top- left to bottom right,
which minimizes the sum of
all numbers along the path.
11 Given string num representing
a non-negative integer num,
and an integer k, return the
smallest possible integer after
removing k digits from num.
12 There is a robot on an m x n
grid. The robot is initially
located at the top-left corner
(i.e., grid[0][0]).The robot
tries to move to the bottom-
right corner (i.e., grid[m - 1][n
- 1]). The robot can only move
either down or right at any
point in time. Given the two
integers m and n, return the
number of possible unique
paths that the robot can take to
reach the bottom-right corner.