printing the elements by removing middle element of stack

Input: First line of input contains a single integer T which denotes the number of test cases. T test cases follows, first line of each test case contains a integer n. Second line consists of n spaced integers.

Output: Print the elements of the stack after deleting the middle element in reverse order.



1 2 3 4 5 6 7

output is:

7 6 5 3 2 1

actually i am able to do printing in reverse fashion but i don't know how to remove middle element from the stack.please help

import java.util.*;


Read More »

By: StackOverFlow - Friday, 9 November

Related Posts