Created
March 11, 2012 13:46
-
-
Save si14/2016505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn leafcount-rec [children root] | |
(let [root-children (get-uuids (root children))] | |
(if (empty? root-children) [root 1] | |
(let [children-leafs (doall (mapcat #(leafcount-rec children %) | |
root-children)) | |
ttt (do (log root) (log (vec children-leafs)) 1) | |
root-leafs (apply + (filter integer? children-leafs))] | |
(concat [root root-leafs] children-leafs))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment