recategorized by
465 views

1 Answer

Best answer
3 votes
3 votes

Ok so we start with small array of size n = 3

Let the array A looks like:-

3 1 2

and Let array B is empty:-

     

Now in the question, it is given that we will be going to fill the array B with the following equation i.e.

B[A[i]] = i / for all i and i = 1,2,3

Now consider the following table to fill the array B

i A[i]  B[A[i] = i View of Array B
1 3 B[3] = 1 {_ , _ , 1}
2 1 B[1] = 2 {2 , _ , 1}
3 2 B[2] = 3 {2 , 3 , 1}

now after that array B will look like this-

2 3 1

you can see that this is also an permutation ( or another way of arranging the elements) of the elements 1,2,3.

Or in other words, you can say that it is a permutation of array A.

Hence answer is Option B)

Hope this helps ...

selected by

Related questions

1 votes
1 votes
1 answer
1
Sandip Shaw asked Feb 25, 2016
2,505 views
#include<stdio.h>int main(){char *s = "Geeks Quiz";int n = 7;printf("%.*s", n, s);return 0;}
2 votes
2 votes
1 answer
2
pC asked Dec 23, 2015
977 views
There has to be a general method in deriving equations based on RMO and CMO .Could any one explain me how to derive formula of RMO and CMO of important matrices likeUpper...
5 votes
5 votes
1 answer
3
11 votes
11 votes
5 answers
4
Vikrant Singh asked Dec 28, 2014
3,618 views
What is the complexity of finding $50^{th}$ smallest element in an already constructed binary min-heap?$\Theta(1)$$\Theta (\log n)$$\Theta (n)$$\Theta (n \log n)$