Developer Minds

Developer Minds

Share

Photos 11/09/2016

Apple is releasing wireless AirPod headphones and everyone is making the same joke

Turing Unveils 2 Smartphones With Insane Specifications, Including Multiple Snapdragon 830 SoCs 08/09/2016

The Turing Phone Cadenza features glorious specifications like two Snapdragon 830 processors (not yet announced), 12GB of RAM, and 512GB of inbuilt storage. If this wasn't crazy enough, the Turing Monolith Chaconne features even larger-than-life specs like three Snapdragon 830 processors, 18GB of RAM, and 786GB of inbuilt storage.
http://gadgets.ndtv.com/mobiles/news/turing-unveils-2-smartphones-with-insane-specifications-including-multiple-snapdragon-830-socs-1455670

Turing Unveils 2 Smartphones With Insane Specifications, Including Multiple Snapdragon 830 SoCs The Turing Monolith Chaconne is expected to release in 2018, and its mammoth 768GB of inbuilt storage will be expandable via two microSD slots.

05/09/2016

Give the solution for the following problem...
Solution can be any programming language...

Given a list of integers, rearrange the list such that it consists of alternating minimum maximum elements using only list operations. The first element of the list should be minimum and second element should be maximum of all elements present in the list. Similarly, third element will be next minimum element and fourth element is next maximum element and so on. Use of extra space is not permitted

Input:
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consist of two lines. The first line of each test case consists of an integer N, where N is the size of array.The second line of each test case contains N space separated integers denoting array elements.


Output:
Corresponding to each test case, in a new line, print the modified list.


Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 200
1 ≤ A[i] ≤ 500

Example:

Input
1
5
4 5 1 2 3

Output
1 5 2 4 3

Want your school to be the top-listed School/college in Bangalore?
Click here to claim your Sponsored Listing.

Telephone

Website

Address


Bagmane Tech Park
Bangalore
560068