I am trying to write a deque class in cpp by link list, however, I have no idea about how to decide the length of the chunks (buffers) when creating the deque.
Choose a good size for chunks will help to cut down the complexity of random visit in the deque.
Should I write a function that when a new element is pushed, it adjust the size of chunks dynamiclly, but i find it will have a high complexity in time since maybe it will move enormous data.
How should i deal with this problem.