Given LinkedList and K=2, N=41->2->3->4->5->6->7->8->9
so Partitioned LinkedList will be
1->2->3->4->5->6->7->8->9
Now delete first K nodes from each subpart and return
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
Given LinkedList and K=2, N=41->2->3->4->5->6->7->8->9
so Partitioned LinkedList will be
1->2->3->4->5->6->7->8->9
Now delete first K nodes from each subpart and return
by Dhaval Dave
by Dhaval Dave
R-1) Written Test
by Dhaval Dave
by Dhaval Dave
Given a sorted array and a number x, find a pair in array whose sum is closest to x.
Examples:
Input: arr[] = {10, 22, 28, 29, 32, 40}, x = 54
Output: 22 and
by Dhaval Dave
by Dhaval Dave
[1] / \ [2] [3] / \ / \ [4] [5] [9] [10] / / \ [8] [6] [7]
say
by Dhaval Dave
by Dhaval Dave
Given a Binary Tree and a positive integer k, print all nodes that are distance k from a leaf node.
Here the meaning of distance k from a leaf means k levels higher than a
by Dhaval Dave
Example:
Inputs: 1->2->3->4->5->6->7->8->NULL and k = 3
Output: 3->2->1->6->5->4->8->7->NULL.
Solution : Reverse a LinkedList keeping