Given a linked list, write a function to reverse every k node (where k is an input to the function)....
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:...
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
Given a keypad as shown in the diagram, and an n digit number, list all words which are possible by pressing these numbers....
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:...
Given an unsorted array arr[] with both positive and negative elements, the task is to find the smallest positive number missing from the array....
Given a binary tree, the task is to find the height of the tree. The height of the tree is the number of vertices in the tree from the root to the deepest node....
Given an array arr[] of size N. The task is to find the sum of the contiguous subarray within a arr[] with the largest sum....
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...
Given a linked list where every node represents a linked list and contains two pointers of its type:...
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...