EPIJ 16.11 Pretty printing problem variant 5


By the problem definition, can a monotonic sequence considered to be a bitonic sequence where the pivot occurs at the last element?


Having re-read the problem a few more times, I think the description constrains the subsequences to be “strictly” bitonic, i.e. each monotonic side of the bitonic sequence must be non-empty. What makes me think that is that the problem says that, for the right side of the bitonic sequence, k <= i < n-1. So, k < n-1. Since n-1 is the last index in a sequence of size n, this means k must be less than the last index. This means the right side must have at least one element. Am I correct in my reasoning?