- Q An IITian student, having forgotten to attend his last Physics lab, has to now cook up a graph for the lab report. He has a moth-eaten journal from ten years ago of the same lab, in which the readings are there, but not in the same order that they were taken down from the experiments. Each reading has an x-value which runs from 1 from to the number of readings, and a y-value, which may be any positive integer. However, only the latter is visible for each reading, in the old report. The student knows that the final graph is a sine wave. With a couple of hours left for submission, he decides that the closest he can get to that is to plot a ``zigzag graph''. He will rearrange the readings in such a way that when a line is drawn between successive readings on the graph, a zigzag pattern is obtained, with every point being at a local maxima or minima of the graph. There may be more than one reading with the same y-value, but if they are placed adjacent, the lab instructor will spot the student's ploy immediately and have him repeat the experiment. Hence, he wants to avoid an arrangement in which this happens. Write a program that given a sequence of readings, determines whether they suit the student's requirements or not. The input consists of n+1 lines, with a single integer on each, when there are n readings. The first number is the number of readings, i.e. n, and the remaining numbers are the y-values of the readings, given in no particular order. The output should be the word ``no'' in lowercase letters, if the readings can't help the hapless student, or the required sequence, if they can. In the latter case, the readings, in the correct order, should be output as a single integer on each line. Hence, for an n-reading problem, for which a ``good'' rearrangement exists, the answer will consist of n lines. There will be at most 500 readings, with y-values in [0,10]. ...
- Q How to pass variables by references?
- Q _____ is also known as ‘Stranger Gas.’?
- Q Is it necessary that each try block to be followed by catch block ?
- Q Disease X succeeds lung disease it may also occur healthy persons the person looks healthier from outside the number of red blood cells in the blood increased and this leads to thickness of the blood as a result of which blood lacks inside the vessels the person suffers heart attack One possible solution is to remove a litre of blood or to control the growth of red blood cells. lung idsease precedes the disease X
- Q What is the difference between sales cloud & service cloud?
- Q In ibm how should web application servers be used with peopletools 8.1x and peopletools 8.4?
- Q What is the usage of ANALYZE command in Oracle?
- Q In HTML, and tags display the enclosed text in
- Q Which Marathi novelist has been selected for the 2014 Jnanpith Award?
- Q Why java doesn't support multiple Inheritance