The deque stores elements in decreasing order

Are you sure about this:
“The deque stores elements in decreasing order.”

Type your question above this line.


Hi @semih_kekul, we are glad you reached us.

Yes the statement is true, as the deque stores indexes of array elements in decreasing order and the front of the dequeue stores the element that is largest till the traversed elements in the array. Whenever an array element is traversed that is larger than the index element stored at back of the deque, it pops, and eventually, the front of deque maintains the max array element.

I hope Educative has helped you in your learning :slight_smile: