Let say I have a AST-structure (a list of lists) like this one :
[+, [*, a,b],[*,c,d] ]
[+, [*, a,b],[*,c,[ +, d, e] ] ]
what is the easiest and/or fastest way to calculate how deep the structure is i.e. how many levels it is ?
As a second option you could also work with it as a String, rather than List-of-Lists (LoL). F.e.:
"[+, [*, a,b],[*,c,d] ]"
I could use both.