Why the problem says recursive method is trivial?


  • 0
    S

    I believe recursive solution for tree preorder traversal is the standard golden way. The code is easily-understandable, elegant and concise.

    But why the problem says recursive method is trivial?

    I guess I am misunderstanding the meaning of "trivial". Does it mean too common or or insignificant?

    Thank you!


  • 6
    S

    'Trivial' does not mean the recursive method is 'not important', but rather it means 'too easy'. Here it suggests the implementation is not complicated enough to be a good test of a programmer's competence.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.