All Questions
10 questions
1
vote
2
answers
77
views
Alternate Tree implementation
I am trying to implement algorithms related to trees in Scala. I have dabbled with the following implementations of a tree. Are there any pros and cons of preferring the non-...
9
votes
2
answers
14k
views
Binary tree implementation in Scala
This is my implementation of a binary tree in Scala. How can this be made better?
...
6
votes
1
answer
1k
views
Mapping a file system to a tree structure
I need to write a very basic file/directory browser. The data structure I'm using is pretty simple - a Node with an optional parent and children. Along with the data structure I also need a simple ...
4
votes
2
answers
587
views
"Functionalizing" this tree walking method and cleaning it up
I have a MessageTree class that represents a binary tree of negative/positive. I'm looking to improve my walkTree method and ...
10
votes
1
answer
1k
views
BFS and DFS tree traversal
I posted some code as part of an answer to another question and I thought it would be a good idea to get that code reviewed also.
Any comments are welcomed, but I am mostly annoyed by ...
5
votes
2
answers
3k
views
BFS tree traversal Scala
I would love some feedback on the following code for BFS traversal in a binary tree. Is there a cleaner way to write this?
...
15
votes
1
answer
693
views
Binary Search Tree Monad Implementation
I've written a Binary Search Tree Monad in Scala. I would like to hear your thoughts on how to improve it (e.g. making insertion/deletion/search faster and more scalable). Also, is there a better way ...
1
vote
1
answer
641
views
Transform a MongoDb parent reference tree into a deep nested tree
Given a mongodb collection that stores trees as nodes with parent references this methods returns a deep nested tree where every child nodes are stored in a property childs[Seq]
...
3
votes
2
answers
642
views
Partial octree implementation
I am just now learning Scala a bit on my own time. I wrote some code that works, but was wondering if you could eyeball it to see if its structure can be improved. It is a partial octree ...
4
votes
1
answer
6k
views
Immutable binary search tree using Scala
I have written a sample immutable binary search tree using Scala. However, I am not sure whether or not I was doing it the proper way since I am not an expert at functional programming. Is there a ...