Answer to Question #331317 in C for shiva

Question #331317

There are two types of fishes in a pond, A and B.there are N fishes of type A numbered from 1 to N and M.the following two methods are adopted by the fishes of type A to satisfy their hunger.

1)E1:Fish of typeA(n1) eats the fish of type B(n2).

2)E2:Fish of type A(n1) eats the fish of type A(n2) if size(n1)>size(n2).

In the above mentioned context,E1and E2 denote the respective methods and n1 and n2 are the fishes belonging to these types and Size(X) denotes the total number of fish within X.

Example:if size(L)=3 and size(K)=2 and L eats K then the resulting size(L) will be5.

It is feeding time now and the fishes are hungry.theyeat as per the given method and satiate their hunger.your task is to find and return an array defining whether which type A fishes do All type B fishes fall under.

Note: the size of all fishes initially is the same i.e,1

In case the fish is is still Alive,then the ith element should be -1.

Ex1:

i/p1:2

i/p2:3

i/p3:4

i/p4:{{1,1,1},{1,1,2},{1,2,3},{2,1,2}}

o/p:{1,1,1}


0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS