How to realize Post-order traversal in C language
This article mainly introduces "how C language realizes post-order traversal". In daily operation, I believe that many people have doubts about how C language realizes post-order traversal. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "how to realize post-order traversal in C language"! Next, please follow the editor to study!
Implementation of subsequent traversal:
Achieve results:
Topic and analysis
The preorder traversal and intermediate order traversal of a given tree are given to find the subsequent traversal.
Input
Abdec
Dbeac
Output
Debca
3. Implementation code:
# include # include using namespace std;string S1 = "abdec"; / / preorder traversal of string S2 = "dbeac"; / / traversal of void calc in the middle order {int m=s2.find (S1 [L1]) {int m=s2.find (S1 [L1])