Skip to content

Tag Archives: Paytm

Given an array of n elements that contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these… Read More
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… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function).  Example:  Input: 1->2->3->4->5->6->7->8->NULL, K =… Read More
Given an array A[], write a function that segregates even and odd numbers. The functions should put all even numbers first, and then odd numbers. Example:  … Read More
Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes some other algorithms (such as quicksort)… Read More
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”… Read More
A tree where no leaf is much farther away from the root than any other leaf. Different balancing schemes allow different definitions of “much farther”… Read More
You are given an array of 0s and 1s in random order. Segregate 0s on left side and 1s on right side of the array.… Read More
Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More
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… Read More
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12,… Read More