Print Nodes at K distance from Root in Binary Tree

Print nodes at K distance from root in binary tree. OR
Print nodes at Level K.


Given a Binary Tree, Print all Nodes that are at K distance from root node in Binary Tree. We can also think of this question as Print all nodes that belong to Level K.
 
Lets understand what will be input and expected output with the help of an example.
 

If k = 2. It means we need to print all nodes that are at distance 2 from Root node.
It also means we need to print all nodes at Level 2, because all Nodes of Level 2 will be at same distance from Root Node.

Rotate matrix by 90 degree

Rotate matrix by 90 degree OR
Turn an 2D array by 90 degree OR

Rotate a two dimensional array OR
Given N*M matrix, rotate it by 90 degree to left and right.

Given N*M Matrix, Rotate it by 90 degrees.
 
Lets understand the problem statement graphically and it will be more clear,  


Lets see given input and expected output below,

Rotate Matrix by 90 degrees clockwise Inplace

Rotate square matrix by 90 degrees Inplace OR
Turn an 2D array by 90 degree OR

Rotate a two dimensional array OR
Given N*N matrix, rotate it by 90 degree to left and right without extra memory

Rotate square matrix by 90 degrees Inplace.
Lets understand the problem statement graphically and it will be more clear,  


Print Matrix in Spiral order using Recursion.

Print Matrix in Spiral order OR
Given m*n matrix(m rows, n columns), print all elements of the matrix in spiral order OR

Print two-dimensional array in spiral order OR
How to print elements of Matrix in Spiral Format?

Given a Matrix(2D array), print it in spiral form. Lets understand the problem statement graphically and it will be more clear,  


Print Matrix in Spiral form

Print Matrix in Spiral order OR
Given m*n matrix(m rows, n columns), print all elements of the matrix in spiral order OR

Print two-dimensional array in spiral order OR
How to print elements of Matrix in Spiral Format?

Given a Matrix(2D array), print it in spiral form. Lets understand the problem statement graphically and it will be more clear,  


Transpose of Matrix Inplace

Transpose of Matrix In-place

You are given a M * N matrix, find Transpose of Matrix in-place. Transpose of matrix is obtained by interchanging rows and columns of a matrix that is by changing rows to columns and columns to rows. 

Lets understand the problem statement graphically and it will be more clear,  
 

Transpose of Matrix in Java

Transpose of Matrix in Java

You are given a M * N matrix, find Transpose of Matrix. Transpose of matrix is obtained by interchanging rows and columns of a matrix that is by changing rows to columns and columns to rows. 

Lets understand the problem statement graphically and it will be more clear,  
 

Implement Queue using One Stack in Java (Recursive Implementation)

Implement Queue using One Stack in Java

You are given a Stack data structure that supports standard push and pop operations. You need to implement Queue data structure using one Stack instances.

Lets understand the problem statement graphically and it will be more clear,  

Implement Queue using Stack

Implement Queue using Stack in Java

You are given a Stack data structure that supports standard push and pop operations. You need to implement Queue data structure using Stack instances.

Lets understand the problem statement graphically and it will be more clear,  

Download binary file AngularJS + REST service

Download binary file using AngularJS + REST service

Many a times we need to download file via POST request, because the request contains extra parameters to pass and GET request is not suitable.   
download file from server example in angularjs
Download file from server example in AngularJS

Lets see example of downloading ZIP file via POST request. 

For downloading file in Angular2 look at this post: Download file in Angular2

Example demonstrates downloading binary file using Javascript and REST service


Once I have faced requirement of downloading binary zip file using AngularJS + REST service and thought of sharing the code, It may help to someone facing similar requirement.