Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720.
We have di...

Share

Given a binary tree, print it vertically. The following example illustrates vertical order traversal.
1
/
2 3
/ /
...

Share

Given a 2D array, print it in spiral form. See the following examples.
Examples:
Input:
1 2 3 4
5 6 7 8
9 10 11 12
...

Share