Suppose it is possible to arrange the nos. 2 to 7 in such a way that every number in the circle is either greater than both of its neighbours or less than both of its neighbours. Now, look at the image below.
Any number placed at the positions a and b must be greater than 1 (since the numbers are chosen from 2 to 7)
So, the number placed at a must be greater than the numbers placed at both of its neighbours. (condition given in the question).
So, the number placed at a is greater than the number placed at f.
Similarly we can say that the number placed at b must be greater than the number placed at c.
By giving similar arguments we can say that
No. placed at e > No. placed at f ....(1)
No. placed at d > No. placed at c ...(2)
No. placed at e > No. placed at d (because of statement (1) ) ...(3)
No. placed at d > No. placed at e (because of statement (2)) ....(4)
Now, statements (3) and (4) can not occur simultaneously.
Hence contradiction.
So,our assumption was wrong.
It is not possible to arrange the nos. 2 to 7 by satisfying the conditions given in the problem.
So, the number of ways = zero.