1. In the method of the problem solution space tree search, one node has multiple opportunities to become a slipknot point is?
Back, dfs obviously can fall back on a track of points. Branch and bound method is bfs, a node to traverse once.
2. Stack simulation using both a realization of a queue, if the capacity of the stack are O and P (O> P), then the simulation to achieve the maximum capacity of the queue is the number?
2P + 1. A stack of large capacity for storing a small stack B for buffering capacity. The stack elements 1 ~ P A, P ~ 1 then pop the stack and then B, then if B pop out from the stack satisfied FIFO queue characteristics. B, not to the first P elements pop out, then A also may be pressed into the P + 1 ~ 2P + 1 elements, and other elements B, 1 ~ P pop out of A 2P + 1 ~ P + 2 can Drawing B, a P + 1 of the left one of the first pop, B and then pop. Satisfy the whole or FIFO, the maximum capacity of the queue 2P + 1
3. The bottom of the stack to sequentially stack storage elements A, B, C, D, E before the fifth element stack, the stack may be a stack of elements, the sequences may be out of the stack
Position E can be casual, but DCBA the order can not be changed.