Vous êtes sur la page 1sur 1

Assignment ( submitted on wed 26-03-2008 till 5:00PM)[C1+C2+C3]

Q1. Find a given element (let 26 or 8th smallest) from the list of elements as given
below by using interpolation and median search( recursive as well as iterative ) and
compare the number of times the recursive statement has been executed. ( Repeat
the same comparison with iterative approaches also).

(i) 1 2 3 4 5 67 89 23 45 24 56 78 94 32 12 11 38 37 (median search)

(ii) 1 2 3 4 7 56 59 78 79 80 82 93 95 96 98 (interpolation and median both)

Q2. Write the median search algorithm recursively by using the pivot as randomly
selected number and middle element . And also execute the q1(i) by your algorithm
and compare the number of swapping made in both of your approaches.

Q3. (i)Design a board of 7 X 7 order. You have to design a recursive procedure


which finds a path from the given(user i/p) source to given destination(user i/p)
without constraints.(movement is one step left, right, up, down)

(iii) You have to design a recursive procedure which finds a path from the
given(user i/p) source to given destination(user i/p) and some tiles on the
board( user inputted)are having holes where no movement is
possible.(movement is one step left, right, up, down)

(iv) The given board is having walls on the cells (means that cell is not
traversable). Now design a recursive code which provides the information
whether the given board ( cell having no walls )is traversable or not with
the movement ( 2.5 right, 2.5left, 2.5down only ie. No upward movement).

[ store the path in the link list in each case]

Note: In q3(i) find at least 10 paths and store them in the file.

[All the assignment should be programmed and program will be submitted


after assignment submission]

Vous aimerez peut-être aussi