Sorting algorithms in Scala

I have been studying Scala, and I’m reviewing basic algorithms too. I thought it would be nice to mix the two of them, so here is an implementation of three sorting algorithms in Scala.

Posted at 10:45 on 2015/02/04 | Leave a comment | Filed Under: Uncategorized | Continue reading

Tail-recursive tree traversal example in Scala

This is a demonstration of a tree-traversal algorithm to calculate the size of a binary tree, in Scala. The two implementations are recursive, as one should try to do in functional programming, but the first implementation is not tail-recursive, and the second is.

Posted at 15:12 on 2014/12/31 | Leave a comment | Filed Under: Uncategorized | Tagged: , , , | Continue reading


I’m Nic, and this blog is my little “programming tricks” notebook. Whenever I see a cool piece of code I find interesting or useful I post it here, with theoretical remarks when appropriate. May post opinion pieces about technology too sometimes. — Nicolau Werneck <>


Get every new post delivered to your Inbox.

Join 652 other followers