The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
–1 vote
80 views
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.
asked in Numerical Ability by Active (1.3k points) | 80 views

2 Answers

+1 vote
in array of size n the number between 1 to n are there in random order(permution).
answered by Active (3.4k points)
0
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

source: https://gateoverflow.in/20611/tifr2011-b-30

answered by Active (1.5k points)

Related questions

0 votes
1 answer
3
+1 vote
4 answers
4
+1 vote
2 answers
5
0 votes
1 answer
6
0 votes
3 answers
7
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
49,814 questions
54,518 answers
188,351 comments
75,294 users