The relevant knowledge mentioned in the article is located in the column: "Data Structure and Course Design"
Preface
This article will introduce in detail the non-recursive traversal algorithm of chained storage binary trees. There are three types, namely pre-order, in-order and post-order. And use these traversal algorithms and add some extensions to complete classic problems, such as finding the height of a tree, traversing in reverse order, etc.
Table of contents
1. Review of recursive algorithms
A brief review of the recursive traversal method of chained storage binary trees:
the code for the binary tree storage structure is given:
typedef struct