Given a circularly sorted integer array, find a pair with a given sum. Assume there are no duplicates in the array, and the rotation is in an anti-clockwise direction around an unknown pivot.
Given an integer array, find an index that divides it into two non-empty subarrays having an equal sum.. The idea is to preprocess the array and store the sum of every index's left and right subarray in two auxiliary arrays.
Given an integer array, rearrange it such that it contains positive and negative numbers at alternate positions. If the array contains more positive or negative elements, move them to the end of the array.
Given an expression consisting of an opening brace `{` and a closing brace `}`, find the minimum number of inversions needed to balance the expression.
In this post, we will see how to left-rotate an array by specified positions. For example, left-rotating array `{ 1, 2, 3, 4, 5 }` twice results in array `{ 3, 4, 5, 1, 2 }`.
This post will discuss how to find permutations of a string using iteration. The implementation should be able to handle strings with duplicate characters and don't repeat the permutations.
Find all n–digit strictly increasing numbers where `n` varies from `1` to `9`. If we process the number from left to right and every digit is greater than the preceding digit, we can say that the number is strictly increasing.
Write a program to print all n–digit binary numbers with k–bits set where `k` ranges from `1` to `n`. The numbers with the same number of bits set should be printed together in ascending order.
Given a positive number `n`, find all strings of length `n` containing balanced parentheses.. The idea is to maintain a count of the open parenthesis in the output string.
Write a program to in-place remove all extra spaces from a string. There maybe leading spaces, trailing spaces, or consecutive spaces between words of the string.
Given an array of positive and negative integers, segregate them in linear time and constant space. The output should print all negative numbers followed by all positive numbers.
Bubble sort is a stable, in-place sorting algorithm named for smaller or larger elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even compared to insertion sort, and is not recommended for large input.
Selection sort is an unstable, in-place sorting algorithm known for its simplicity. It has performance advantages over more complicated algorithms in certain situations, particularly where the auxiliary memory is limited.
Insertion sort is a stable, in-place sorting algorithm that builds the final sorted array one item at a time. It is not the very best in terms of performance but more efficient traditionally than most other simple O(n^2) algorithms such as selection sort or bubble sort.
Write a program to determine if a given string is palindrome or not. A palindromic string is a string that remains the same with its characters reversed.