Traversal of Scalaz's Tree Inorder

28 views
Skip to first unread message

Henry Katz

unread,
Apr 5, 2017, 3:08:48 AM4/5/17
to scalaz
Hi,

Has anyone run across a method to perform an InOrder traversal of this Tree which comes with a PRE and a BFS order but not
an InOrder Traversal?


Dave Stevens

unread,
Apr 5, 2017, 8:59:23 AM4/5/17
to sca...@googlegroups.com
scalaz.Tree is not a binary tree. It supports an arbitrary number of
arbitrary number of children. You could probably shoe-horn some
abstraction on top of it, but you're probably asking the wrong list if
you are going to attempt something like that. If you need a binary
tree, you would be better off using a type more accurately defining a
binary tree.
> --
> You received this message because you are subscribed to the Google Groups
> "scalaz" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scalaz+un...@googlegroups.com.
> To post to this group, send email to sca...@googlegroups.com.
> Visit this group at https://groups.google.com/group/scalaz.
> For more options, visit https://groups.google.com/d/optout.

Henry Katz

unread,
Apr 5, 2017, 10:52:55 AM4/5/17
to scalaz
Understood, it is a rose tree. Not seeking order just thought this would be simpler without having
to reinvent the wheel.

Henry Katz

unread,
Apr 5, 2017, 11:14:22 PM4/5/17
to scalaz
Have had some help from an office colleague that used a recursize list algorithm to resolve this issue.
Reply all
Reply to author
Forward
0 new messages