Tonight, I have been reading Scala tutorial. Quite good for a java programmer.
Still, need to understand
case calsses and pattern matching
trait
anonymous function
function is an object
I also like the tutorial here at tutorialspoint
Wednesday, December 10, 2014
How to post code snippets onto blogger
copy from http://kasun86.blogspot.com/2011/07/posting-code-snippets-to-blogger.html
In my last post I wanted to put some Java and JavaScript code snippets in it so I started googling and asking my friends how to do it. But, I could not find an easy way to do that so I started searching more and found the following which is actually a zero work thing to do. Here we go,
In my last post I wanted to put some Java and JavaScript code snippets in it so I started googling and asking my friends how to do it. But, I could not find an easy way to do that so I started searching more and found the following which is actually a zero work thing to do. Here we go,
- Browse to https://gist.github.com/
- Add a Gist Description (optional)
- Add a filename with an extension (extension will be used to add syntax highlighting)
- Add your code snippet which need to be added to your blog post
- Click “Create Public Gist” button at the botton
- Click on the “embed” link and copy the script generated
This is all from Gist side. Now to Blogger,
7. Paste the script where you need to add the code snippet
8. Make sure to select the option “Interpret typed HTML” under Post Options -> Compose Settings
Here is how an example Java code looks like after this 8 Steps above,
Tuesday, December 9, 2014
Leetcode - Maximum Depth of Binary Tree
Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down
to the farthest leaf node.
Solution:
1. Recursive:
2. Non-recursive:
Subscribe to:
Posts (Atom)