Little knowledge of C language --- the use of recursive functions

  C language allows functions to call themselves, which is called recursion. When many people first learn recursion, they are often confused by layers of nested calls. They don't know how to call them? Now let's use a small example to demonstrate how the function works when it is called recursively. void up_and_down(int n) { printf("---- ...

Posted on Fri, 01 Oct 2021 17:56:50 -0400 by jaku78

Four traversal methods of tree (recursive and non recursive implementation c++&java)

Traversal of tree: 1. Preorder traversal 2. Middle order traversal 3. Post order traversal 4. Sequence traversal 1. Preorder traversal         Preorder traversal, that is, DLR, first accesses the root node, then the left subtree, and then the right subtree. Therefore, traversal and backtracking are required Recursio ...

Posted on Wed, 22 Sep 2021 08:08:58 -0400 by pelleas