Review that a change of length n is a cluster comprising of n unmistakable integers from 1 to n in discretionary request. For instance, [2,3,1,5,4] is a change of length 5, yet [1,2,2] isn't a stage (2 shows up twice in the exhibit) and [1,3,4] is additionally not a change (n=3 but rather there is 4 in the cluster).    Your undertaking is to track

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else Multiple Downvoted. Computer science.

You are given one integer n (n>1). 

 

Review that a change of length n is a cluster comprising of n unmistakable integers from 1 to n in discretionary request. For instance, [2,3,1,5,4] is a change of length 5, yet [1,2,2] isn't a stage (2 shows up twice in the exhibit) and [1,3,4] is additionally not a change (n=3 but rather there is 4 in the cluster). 

 

Your undertaking is to track down a stage p of length n that there is no file I (1≤i≤n) to such an extent that pi=i (along these lines, for all I from 1 to n the condition pi≠i ought to be fulfilled). 

 

You need to answer t autonomous experiments. 

 

In case there are a few replies, you can print any. It tends to be demonstrated that the appropriate response exists for each n>1. 

 

Input 

 

The main line of the input contains one integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow. 

 

The main line of the experiment contains one integer n (2≤n≤100) — the length of the stage you need to find. 

 

Output 

 

For each experiment, print n particular integers p1,p2,… ,pn — a stage that there is no list I (1≤i≤n) to such an extent that pi=i (along these lines, for all I from 1 to n the condition pi≠i ought to be fulfilled). 

 

In case there are a few replies, you can print any. It very well may be demonstrated that the appropriate response exists for each n>1.

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education