You are on page 1of 8

WATER JUG PROBLEM

AIM: To write a C program to perform the water jug problem using BFS & DFS technique. ALGORITHM : 1. Start the program. 2. Enter the input for quantity of both the jugs the required output & the jug in which the output is required. 3. The start state is taken as (0,0). 4. A tree is computed in which each node having all the values 5. The node is searched using BFS & DFS technique. 6. When the node having the desired output is found then execution stops 7. All the traversed nodes are printed 8. Stop the program.

SINGLE PLAYER GAME


AIM : To write a C program to implement a single player game. ALGORITHM : 1. Start the program. 2. The global variable and functions are defined. 3. Main() is declared. 4. Define the Menus and functions 5. Declare the using() and check() for checking rows & columns. 6. Define the first function of the player to start playing. 7. Put x-o function is declared to play with x. 8. Display the proper message when the game is over. 9. Stop the program.

TWO PLAYER GAME


AIM : To develop a program to implement the two player game. ALGORITHM : 1. Start the program. 2. The global variable and functions are declared. 3. Define the player(int,int) function to accept the row & column from the user i.e player 1 and player 2. 4. Define check() function to check whether the accepted value is valid or not. 5. Define print() function to display the board. 6. Display the result i.e. player 1 wins or player2 wins or match drawn. 7. Stop the program.

PREDICATE LOGIC
AIM : To develop a program to implement the concept of predicate logic ALGORITHM : 1. 2. 3. 4. 5. 6. 7. Start the program All possible conclusions are stored in a database. Set of statements are stored and displayed on the screen. From the given statements the user is asked to enter the conclusion. If conclusion entered matches the one stored in database then Logic is correct is displayed otherwise logic is incorrect is displayed. Stop the program.

A* ALGORITHM
AIM : To write a program to implement A* algorithm. ALGORITHM : 1. Start with OPEN containing only initial node. 2. Set SUCCESSOR point back to BESTNODE. 3. Compute g(SUCCESSOR)=g(BESTNODE) + cost of getting from BESTNODE to SUCCESSOR. 4. If SUCCESSOR is same as any node on OPEN then call that node as OLD .Add OLD to list of BESTNODEs SUCCESSOR. 5. If OLD node is cheaper than SUCCESSOR then reset OLDs parents link to point BESTNODE. 6. If SUCCESSOR is not in OPEN see if it is in CLOSED 7. If it is neither in OPEN or CLOSE put it in OPEN F(SUCCESSOR) =g(SUCCESSOR) + h(SUCCESSOR) 8. Terminate the program

SENTENCE CHECKING
AIM : To write a C program to check whether the given statement is valid or not. ALGORITHM : 1. Start the program. 2. Enter the sentence. 3. Enter the number of productions and the productions. 4. Check id given sentence can be obtained through given grammar. 5. If yes print the sentence is valid. 6. Otherwise print sentence is invalid 7. Terminate the program

AO* ALGORITHM
AIM : To write a program to implement AO* algorithm. ALGORITHM : 1. Let graph consists of only nodes representing initial state. 2. Until INIT is labeled solved value becomes greater than Futility.\ a. Trace the labeled arcs from INIT a node is selected called NODE. b. Generate the SUCCESOR of NODE c. Propagate newly discovered information up the graph by doing the following Initialize S to NODE. d. Select S, a node ,none of whose descendants in Graph call it as current. e. Compute the cost of each arc. f. Mark the best part of current with minimum cost. 3. Terminate the program

MEDICAL DIAGNOSIS

AIM : To write a program to diagnose the disease. ALGORITHM : 1. 2. 3. 4. Start the program Enter input for temperature, blood pressure and pulse rate. The symptoms of disease is to be entered. If temperature ,blood pressure , pulse rate is detected as normal no disease is detected. 5. Otherwise according to symptoms disease is detected. 6. Terminate the program 7.

You might also like