39
правок
Изменения
Дек
,→Циклический дек на динамическом массиве
'''if''' (d.head == d.tail)
'''T''' newDeque[capacity * 2]
'''for''' i = 1 0 '''to''' capacity - 1
newDeque[i] = d[d.head + 1]
d.head = (d.head + 1) % n
'''if''' (size() < capacity / 4)
'''T''' newDeque[capacity / 2]
'''for''' i = 1 0 '''to''' size()
newDeque[i] = d[d.head + 1]
d.head = (d.head + 1) % n
'''if''' (d.head == d.tail)
'''T''' newDeque[capacity * 2]
'''for''' i = 1 0 '''to''' capacity - 1
newDeque[i] = d[d.head + 1]
d.head = (d.head + 1) % n
'''if''' (size() < capacity / 4)
'''T''' newDeque[capacity / 2]
'''for''' i = 1 0 '''to''' size()
newDeque[i] = d[d.head + 1]
d.head = (d.head + 1) % n