Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correct in exp....
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”...
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum....
Given a Romal numeral, the task is to find its corresponding decimal value....
Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples :...
Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the output should be 3. If there are even nodes, then there would be two middle nodes, we need to print the second middle element. For example, if given linked list is 1->2->3->4->5->6 then the output should be 4....
Given a matrix, clockwise rotate elements in it....
Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space.Examples :...
Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element on the right side of x in the array. Elements for which no greater element exist, consider the next greater element as -1....
Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space.Examples :...
Given a Romal numeral, the task is to find its corresponding decimal value....
Given an unsorted array of integers, sort the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form if arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >= ….....