Print Nodes at K distance from Root in Binary Tree

Print Nodes at K distance from Root in Binary Tree
Print nodes at K distance from root in binary tree. ORPrint 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.  ...

Rotate matrix by 90 degree

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...

Rotate Matrix by 90 degrees clockwise Inplace

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...

Print Matrix in Spiral order using Recursion.

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...

Print Matrix in Spiral form

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...

Transpose of Matrix Inplace

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...

Transpose of Matrix in Java

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...

Implement Queue using One Stack in Java (Recursive Implementation)

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...

Implement Queue using Stack

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...

Download binary file AngularJS + REST service

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...

Burning Rope Puzzle - Measure 45 Minutes

Burning Rope Puzzle - Measure 45 Minutes
The Burning Rope Puzzle You have 2 ropes. Each takes exactly 60 minutes to burn. They are made of different material so even though they take the same amount of time to burn, they burn at separate rates.  In addition, each rope burns inconsistently....

Implement Stack using One Queue

Implement Stack using One Queue
Implement Stack using Single Queue in Java You are given a Queue data structure that supports standard enQueue and deQueue operations.  You need to implement Stack data structure using Single Queue. Lets understand the problem statement graphically...

Implement Stack using Queue

Implement Stack using Queue
Implement Stack using Queue in Java You are given a Queue data structure that supports standard enQueue and deQueue operations.  You need to implement Stack data structure using Queue instances. Lets understand the problem statement graphically...

Find Smallest and Second smallest element in array.

Find Smallest and Second smallest element in array.
Find Smallest and Second smallest number in array. Given a integer array, find smallest and second smallest number in array. Lets understand the problem statement graphically and it will be more clear, Find smallest and second smallest element in...

Find Largest and Second Largest number in array

Find Largest and Second Largest number in array
Find Largest and Second Largest number in array Given a integer array, find largest and second largest number in array. Lets understand the problem statement graphically and it will be more clear, Find the largest and second largest element in...

Find Largest and Second Largest number in array and Find Smallest and Second Smallest number in array

Find Largest and Second Largest number in array and Find Smallest and Second Smallest number in array
Find Largest and Second Largest number in array OR Find the smallest and second smallest element in array. Given a integer array, find largest and second largest number in array. Lets understand the problem statement graphically and it will be...

Find Largest and Smallest number in Array

Find Largest and Smallest number in Array
Find minimum and maximum number in array Given a integer array, find minimum and maximum number in array. Lets understand the problem statement graphically and it will be more clear, Find minimum and maximum element in an array in Java...
Page 1 of 2812345...28Next »