binary tree - Can someone give an example of how edit function for clojure.zip works? -
I am a newcomer for the closure and I was working with Closer.zip, and was not able to understand it How to edit the function in it If someone gives me an example of work, then it will really be helpful.
For example, I have a binary tree
45 10 57 How do I edit value 57 and say it to 75 A structure of nested vectors in which the first element is worth, the other is the left child and the third right is to be changed.
Child, this will work:
([btree [10 [10]] [57] The original place (zip / zipper vector? Rest (FN [[x _ _] children] (VCC (Cons. X child))) BTI)] (-> Root-Lok zip / down h Although / right (Zip / Edit (Fan [node] (Asosi in node [0] 75))) ZIP / root)); = & Gt; [45 [10] [75]]
Comments
Post a Comment