- Ohani And Binary Search Tree
I am solving a problem and its input is of the form --
1
4
1 4 2 3
The first line is no of cases
Follwed by input length
Follwed by all integers of given length in random order
this is my code
public static void main(String args[]) throws IOException
{
BufferedReader reader = new BufferedReader(
new InputStreamReader(System.in) );
int inputLen = Integer.parseInt(reader.readLine());//read the first line
int [] correction = new int[inputLen];
int [] len = new int[inputLen];
for(int i=0;i<inputLen;i++)
{
StringTokenizer tokenizer = new StringTokenizer(reader.readLine());//read second line
int x = .........//Use this tokenizer to perform some opertaion .......
tokenizer = new StringTokenizer(reader.readLine()," "); // the third line
int pos=0;
int last=-1;
while (tokenizer.hasMoreTokens() )
{
int temp = Integer.parseInt(tokenizer.nextToken());
}
//do some procesing
}
I wonder what im doing wrong here