The Gateway to Computer Science Excellence
–1 vote
What does it mean when they say "An array A[1...n] consists of a permutation of numbers 1....n.".?

Also I'd be grateful if you give some example.
in Numerical Ability by Active (1.3k points) | 98 views
For numbers 1,2,3 total possible permutations are 1,2,3; 2,3,1; 3,1,2; 2,1,3; 1,3,2; 3,2,1. Basically we say 3,1,2 is a permutation of 2,1,3. We can say for any of the combinations.

2 Answers

+1 vote
in array of size n the number between 1 to n are there in random order(permution).
by Active (3.6k points)
Thank you @Dharmendra Lodhi!
0 votes

let n=2 
A[1,2] and it consists of a permutation of numbers 1,2 which are  
case 1: (1,2) 
case 2: (2,1) 
B[A[i]]:=i  for all i (GIVEN) 
case 1: B[A[1]]:=1 B[1]:=1 
             B[A[2]]:=2 B[2]:=2 so B=(1,2) 
case 2: B[A[1]]:=1 B[2]:=1 
             B[A[2]]:=2 B[1]:=2 so B=(2,1) 
Hence array B have permutation of 1,2

Ans is B


by Active (1.9k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,650 questions
56,242 answers
95,935 users