programmer group

Luogu P1430 sequence access

If so http://www.cnblogs.com/hehe54321/p/loj-1031.html If we do the $O(n^3) $method, it will fall, but in fact, there is room for optimization. All operations can be divided into two steps: the first step is to take a number at one end of the sequence and add it to your score; the second step is to give yourself or the other party the right to the next operation. If the previous operation of this operation is the operation of the...

programmer group

Data structure -- implementation of queue

Before that, we have known the sequence list and chain list. Now, the stack and queue we need to know are essentially based on the above two. The stack stresses "last in, first out". Unlike the queue, it requires "first in, first out". For the stack, according to the rules, we have learned that the "in" of the stack is "tail insertion", and the "tail data" of the stack's out stack...