Javascript Program to Find if there is a subarray with 0 sum
Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum....
read more
Php Program to Arrange given numbers to form the biggest number
Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value....
read more
Javascript Program For Reversing A Linked List In Groups Of Given Size- Set 2
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples:...
read more
Php Program to Rearrange positive and negative numbers in O(n) time and O(1) extra space
An array contains both positive and negative numbers in random order...
read more
Sort an array of 0s, 1s and 2s | Dutch National Flag problem
Given an array A[] consisting of only 0s, 1s, and 2s. The task is to sort the array, i.e., put all 0s first, then all 1s and all 2s in last....
read more
Reverse words in a given string
Given a string, the task is to reverse the order of the words in the given string....
read more
Search an element in a sorted and rotated Array
Given a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array....
read more
Recursively remove all adjacent duplicates
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples....
read more
Java Program for Rearrange positive and negative numbers in O(n) time and O(1) extra space
An array contains both positive and negative numbers in random order...
read more
C++ Program To Reverse Words In A Given String
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
Java Program To Reverse Words In A Given String
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
C Program For Stock Buy Sell To Maximize Profit
Efficient approach: If we are allowed to buy and sell only once, then we can use following algorithm. Maximum difference between two elements. Here we are allowed to buy and sell multiple times. Following is the algorithm for this problem....
read more