Johny22 wrote:For the first problem I need to convert from one tree form into another.
Johny22 wrote:For the answer for the second problem:
What do you mean by flatten the list ?
I tried to remove the math operators, and than to get nth n from the new list, but i couldn't write it in lisp. there is a special function so i can use to chech if the list elements are alpha-numerical and than use the delete-if function ?
Johny22 wrote:In LISP i can represent it in two ways(two are asked) one is (a (b e) b (c d) e (f))) an the second one is (a (b (c d) e)). I need to convert from one representation to another one.
Johny22 wrote:That is only a simple example, for more complex ones the math operator can be somewhere in the middle, anyway I will read more about flattening and try that one.
Johny22 wrote:i mean like this (+ (* 2 3) (/ 8 2)), or more complex ones, i wonder if there is a function that test for alpha-numeric elements, for example : if not alpha-numeric remove from list => ((2 3)(8 2)) and then to aply the nth element to return the variable that i look, but for this i will look into myself, i only want to know if there is a function that can test for that alhpa-numeric.
Johny22 wrote:the argument can also be like (+ (* a b)(/ c a )), i think i will combine that alphanumericp and numberp functions to remove any other symbol and than use nth on the resulting list.
Users browsing this forum: No registered users and 1 guest