0% found this document useful (0 votes)
17 views3 pages

23 March

sdv i sdivnaoncosnbonaodnosnovnoaNCOVSDNANVON

Uploaded by

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

23 March

sdv i sdivnaoncosnbonaodnosnovnoaNCOVSDNANVON

Uploaded by

Apex Shamsh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ArtificialIntelligenceLab

CSP472

B.TechCSE(IOT&Application)
4thyear 7thSemester
Session:2023-24

DEPARTMENTOFCOMPUTERSCIENCE&ENGINEERINGSHARDA UNIVERSITY,
GREATER NOIDA

LABFILE

SubmittedTo:Assistant Professor Dharm Raj

SubmittedBy:

Name: Shamsh Iqubal Ahmad Perdesi

SystemID-2020541048
Roll No-200101286
Section-F
Group-G2
INDEX
S.No. Experiment Date Page Sign

1 ImplementationofWaterJugProblem

2 Introductionto Lisp,and basicprogramming inLisp likefollowing:


i. WriteaLISPfunction tocomputethesumof squares.
ii. WriteaLISPfunctiontocomputethedifferenceofsquares. (if x
> y return x2– y2, Otherwise y2– x2).
iii. WriteaRecursiveLISPfunctionwhichtakesoneargument as a
list and returns the last element of the list. (Do not use the
last predicate.)
iv. Write a Recursive LISP function which takes one argument
asalistandreturnlistexceptthelastelementofthelist.(Do not use
butlast.)
v. WriteaRecursiveLISPfunctionwhichtakesoneargument as a
list and returns the reverse of the list. (Do not use reverse
predicate).
vi. WriteaRecursiveLISPfunctionwhichtakestwoarguments first
an atom second a list returns a list after removing the first
occurrence of that atom within the list.
vii. WriteaRecursiveLISPfunctionwhichappendstwolists
together.
viii. Write a recursive LISP function which takes 2 lists as
argumentsandreturnsalistcontainingalternateelements
from each list.

3 Advanceprogrammingin Lisplikefollowing:
i. Write a function that compute the factorial of a
number.(factorial of 0 is 1, and factorial of n is n*(n-
1)*...1.Factorial is defined only for integers greater than or
equal to 0.)
ii. Write a function that evaluates a fully parenthesized infix
arithmeticexpression.Forexamples,(infix(1+(2*3)))should
return 7.
iii. Write a function that performs a depth first traversal of a
binary tree. The function should return a list containing the
tree nodes in the order they were visited.
iv. WriteaLISPprogram forwaterjug problem.
v. Write a LISP program that determines whether an integer is
prime.

4 Referfollowingfigureasmapwithdistancedetails,Writeaprogram in
your preferred language to generate path from ARAD to
BUCHREST, analyze result obtained by
a)Depth First Search
b) BreadthFirstSearch
c) UniformCostSearch

5 Writeaprograminyourpreferredlanguagetogeneratestepstosolve Tower
of Hanoi problem.

6 Writeaprograminyourpreferredlanguagetosolvethe8puzzle
Problem-using A* algorithm.
7 WritePROLOGprogramtoProgramtocategorizeanimal characteristics.

8 WritePROLOGprogramtosolverfor thelinearequationA*X+ B
=0.Letthepredicatelinear(A,B,X)returntherootXofthe equation

9 Write a PROLOG program that answers questions about family


members and relationships including predicates and rules which
definesister,brother,father,mother,grandchild,grandfatherand uncle.
The program should be able to answer queries such as the following:
father(x,Amit)
grandson(x,y)
uncle(sumit,puneet)
mother(anita,x)

You might also like