Develop a program
which reads the values corresponding to a signal and
recognizes the characteristic frequencies.
A triplet in a signal is a triplet signal values with
following properties: (a) the two extreme values are equidistant from the middle
value, and (b) the two extreme values are equal and
less than half the median value.For example, the triplet
values are shown in bold below, are triplet:
The median value of a triplet gives the characteristic frequency
equal to the median position in the signal.At
example above, the frequency characteristic is 6 (because the
5 median price is the sixth number displayed in the signal).Input files:
The input files named seti.in are text files with
structure: They have exactly two lines. The first is an integer
number N (10 ≤ N ≤ 10.000), corresponding to the number of values
the signal we entered. The second line has N
integers separated by two to one space.
The output files named seti.out are text files with
following structure: The first line has an integer number K
(0 ≤ K ≤ N). This number represents the number of charac-
teristics frequencies identified. Follow K lines
each of which has an integer M, (2 ≤ M ≤ N-1).
The number M is a characteristic frequency, namely
position of the middle value of the corresponding triplet in the signal (the
numbering begins with 1). The characteristic frequencies should
be given in ascending order. If a frequency characteristic
match more triplets, the frequency should be
appears only once.
I think I help you to help me if you have any question reply
or if you can help me reply