My new development team asked me to pick a topic and do a presentation on it. The only condition: the topic should be novel and at the same time relevant. And I need not second guess the first thing that came to my mind: Project Lambda.
Java developers, or at least those in tune with the developments in this space, would not be the last people to form an opinion on this initiative. (Yes, if you're a Java programmer, YOU SHOULD KNOW ABOUT THIS INITIATIVE AND HAVE AN OPINION ON THIS.) It's hard not to form an opinion around this initiative if you're really into Java.
I know people who are actually against adopting JSR-335 (it's corresponding JSR label). And equally there are people who accept anything coming out of the JSR's as positive innovation. For me, I would like to accept the developments with some caution. I'm excited with the introduction of a formal language syntax to create lambda expressions in Java. But I also know, Java is an object oriented language. How would Java programmers used to OOP code closures? Will most of us fall into the trap of coding stateful (rather than stateless) closures (an oxymoron, but it seems Project Lambda seems to allow Java closures to change state).
In any case, my contribution to the community is to post my presentation. Hope it adds clarity (rather than introduce more noise).
Follow this link to my Google drive presentation: Project Lambda
Saturday, November 24, 2012
Tuesday, March 06, 2012
Non-Recursive Binary Tree Traversal Java Implementation
Now that I have more time to think about this, I have finally completed my own solution to the problem... another entry to the long (and hopefully not erroneous) list of "solutions" listed in Google. My inspiration to write my own implementation was when I was Googling for a proper solution, some solutions in the net were actually a bit dodgy and erroneous (especially when it is about the tricky non-recursive post order traversal of a binary tree).
Problem: Given a binary tree, formulate an algorithm to traverse the nodes of the binary tree without using recursion for the following modes:
Now, before we go any further, you may ask me why is this of paramount importance to find a proper non-recursive solution to this academic problem. And my response is... well it just makes me sleep well tonight blogging about this. ;) (Also hoping that Google would take notice and ahem... check out my CV).
So here goes:
Problem: Given a binary tree, formulate an algorithm to traverse the nodes of the binary tree without using recursion for the following modes:
- pre-order traversal
- in-order traversal
- post-order traversal
Now, before we go any further, you may ask me why is this of paramount importance to find a proper non-recursive solution to this academic problem. And my response is... well it just makes me sleep well tonight blogging about this. ;) (Also hoping that Google would take notice and ahem... check out my CV).
So here goes:
Adding Code Snippets to Blog
Since I have all the time now to play with my blog, I've been experimenting on how to add code snippets into my posts (since I'm a programmer... just comes naturally that I should be posting codes eventually).
However, to my surprise, this feature does not come out of the box for most blogging service. However, it is available as a mash-up.
Good old Google pointed me to this blog:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html
The blog details how to integrate SyntaxHighlighter on your blogger template (or any blogging service theoretically).
http://alexgorbatchev.com/SyntaxHighlighter/about.html
However, to my surprise, this feature does not come out of the box for most blogging service. However, it is available as a mash-up.
Good old Google pointed me to this blog:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html
The blog details how to integrate SyntaxHighlighter on your blogger template (or any blogging service theoretically).
http://alexgorbatchev.com/SyntaxHighlighter/about.html
public interface Abc {
void method1();
void method2();
}
Subscribe to:
Posts (Atom)