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