Stack (stack)


 

 L

 


 

Second, the stack of action:

 

 

 

  • Mechanism combined with the function call stack implementation and introduction process is generally a function call, and promote it to the recursive call.
  • To reduce the complexity of the target space as a clue, introduced by typical methods and techniques to maintain the structure of explicit stack to solve application problems.
  • Using the stack structure, efficient heuristic search algorithm based on backtracking strategy.
  • Based on a common circulation distributor rotation policy, and bank windows services, for example to achieve the basic scheduling algorithm.

One end of the stack is referred to as blind end of the operation is prohibited,

 

 

 


Three, Stack template class:

 The end of this vector as a stack inlet:

 

 

 

 

 

 


 

Third, the application of a Stack: Reverse output

  Output order and the order of the process is reversed; recursion depth and length of the output are not easily known.

Base conversion example:

  

 

 

 Iterative implementation:

  

 

 

 


Fourth, the application of a Stack: recursively nested

  Self-similar problem may be recursively described, the branching position and nesting depth uncertainty.

 

 

 

 

 Cut-and-conquer and divide and conquer: Failure! ! !

  

 

 Conceived ideas:

 

 

 


 

 

 

 

 


 Five stacks and recursion

  The amount of space required for the recursive algorithm, mainly determined by the maximum recursion depth,

 

Guess you like

Origin www.cnblogs.com/ccpang/p/11440624.html