recategorized by
739 views

1 Answer

Best answer
3 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
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
3.0k
3.0k views
Sandip Shaw asked Feb 25, 2016
2,982 views
#include<stdio.h>int main(){char *s = "Geeks Quiz";int n = 7;printf("%.*s", n, s);return 0;}
2 2 votes
1 1 answer
1.4k
1.4k views
pC asked Dec 23, 2015
1,439 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 5 votes
1 answers 1 answer
1.8k
1.8k views
ankitgupta.1729 asked Nov 9, 2017
1,813 views
33. Which of the following statements about max heap are true ?(I) To find the kth largest element in the heap, the time required is $\mathrm{O}(\mathrm{klogn})$, where k...
11 11 votes
5 answers 5 answers
6.0k
6.0k views
Vikrant Singh asked Dec 28, 2014
5,980 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)$