Identify the type of array
Interview question:
- An array is given and it can be of four types:
(a). increasing
(b). decreasing
(c). first increasing then decreasing
(d). first decreasing then increasing
Without traversing the array we need to tell its type.There was a long discussion on this question.
use compare
ReplyDelete