math - Are there any example of Mutual recursion? -


are there example recursive function call other 1 calls first 1 ?

example

function1() {         //do      f2();     //do }  function2() {     //do      f1();     //do } 

mutual recursion common in code parses mathematical expressions (and other grammars). recursive descent parser based on grammar below naturally contain mutual recursion: expression-terms-term-factor-primary-expression.

expression     + terms     - terms     terms  terms     term + terms     term - terms  term     factor     factor * term     factor / term  factor     primary     primary ^ factor  primary     ( expression )     number     name     name ( expression ) 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -