Convert tree to list
问题 How can I convert a tree to a list: So far I have the following code but its giving several issues: type 'a tree = Lf | Br of 'a * 'a tree * 'a tree;; let rec elementRight xs = function | LF ->false | Br(m,t1,t2) -> if elementRight xs t1 = false then t1::xs else element xs t1;; //cannot find element let rec elementLeft xs = function | LF ->false | Br(m,t1,t2) -> if elementLeft xs t2 = false then t2::xs else element xs t2 ;; //cannot find element let rec element xs = function | LF ->[] | Br(m