Question: Discrete mathematics How to solve this? 3. (a) Consider the following function: Function Foo (Relation[] [],i,j,n) Array Relation[1..n] [1..n) of integer i,j,n: integer Begin If

Discrete mathematics

How to solve this?

Discrete mathematics How to solve this? 3. (a) Consider the following function:

3. (a) Consider the following function: Function Foo (Relation[] [],i,j,n) Array Relation[1..n] [1..n) of integer i,j,n: integer Begin If (Relation[i][j] != Relation[j][i]) then Return (false) If ((i = n) and (j = n)) then Return(true) Else If ((i > n) and ( = n)) then Foo (Relation[] [], i+1,1,n) Else Foo (Relation [[], i, j+1, n) End () What is the returned value if the function was called with the following parameters: Foo (Relation[[1,1,1],[1,0,0), (1,0,0)), 1, 1, 3)? Hint MRelation = 1 1 1 1 1 00 L100 (10/100) (ii) What happens if the function was called with the following parameters: Foo (Relation[[1,1,1],[1,0,0],[1,0,0]], 5, 5, 3)? (10/100) (iii) What is the task of the given function Foo? (5/100) (iv) Write a loop function that can accomplish the same task. (25/100)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!