section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not.

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

Detail code only else downvoted.

 

section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not. 

You are given an integer n. You will likely develop and print precisely n diverse customary section arrangements of length 2n. 

Input :The primary line contains one integer t (1≤t≤50) — the number of experiments. Each experiment comprises of one line containing one integer n (1≤n≤50). 

Output :For each experiment, print n lines, each containing an ordinary section grouping of length precisely 2n. All section groupings you output for a testcase ought to appear as something else (however they might rehash in various experiments). In case there are different replies, print any of them. It tends to be shown that it's consistently conceivable

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
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