You are on page 1of 2

Special Assignment 3

Programming Problem
Data structures (CSE-A & CC-A)
Deadline 07-09-16
1. You have to find a path through which the rat move from the starting position (x,y) to the
final position where cheese is (m,n). List the total no of possible paths which the rat can take
to reach the cheese.

Input
A file whose first line contains the size of the square maze, the second and third lines contain
the starting and final position.
The next n lines contain n binary values separated by space. 0 denotes an open cell while 1
denotes a blocked cell.
You have to find paths which contain only cells which are open, and finally print the total no
of such unique paths. Retracing the 1 or more cells back and forth is not considered a new
path. The set of all cells covered in a single path should be unique from other paths

Output
The output should be the total no of paths possible from the starting position (x,y) and also
show the path.

Example
Input:
7
2 0 [x y]
7 7 [m n]
0010010
1011000
0000101
1010000
1011010
1000010
1111000

Output:
3

1:0010010
1011000
**00101
1*10000
1*11010
1****10
1111***
Same for remaining 2 paths

2. Write a c function code to solve Josephus problem assume that if you pass P (people), T
(Term), L (Lives) function return last people who is alive. If (P, T, L) = (10, 3, 2) then
diagram is look like as follows

Submit your code at


(Keep your file name as RegistrationNo.doc/15123456.doc)
https://www.dropbox.com/request/KZ502xuKIyI6o2pUWsaC

You might also like