Category: String

Longest Palindromic Subsequence using Dynamic Programming

The Longest Palindromic Subsequence (LPS) problem is the problem of finding the longest subsequences of a string that is also a palindrome. Get great deals at Amazon

Longest Common Substring problem

The longest common substring problem is the problem of finding the longest string (or strings) that is a substring (or are substrings) of two strings.

Longest Common Subsequence | Finding all LCS

Given two sequences, print all the possible longest common subsequences present in them.

Longest Common Subsequence (LCS) | Space optimized version

Write space optimized version of LCS problem.

Longest Common Subsequence | Introduction & LCS Length

The longest common subsequence (LCS) problem is the problem of finding the longest subsequence that is present in given two sequences in the same order. i.e. find a longest sequence which can be obtained from the first original sequence by deleting some items, and from the second original sequence by deleting other items.

Find all combinations of non-overlapping substrings of a string

Given a string, find all combinations of non-overlapping substrings of it. The solution should use parenthesis to split the string into non-overlapping substrings.

Generate Binary Numbers Between 1 to N using Queue

Given a positive number N, efficiently generate binary numbers between 1 to N using queue data structure and in linear time.

Find all N-digit binary numbers with k-bits set where k ranges from 1 to N

Write a program to print all N-digit binary numbers with k-bits set where k ranges from 1 to N. Numbers with same number of bits set should be printed together and in ascending order.

Find all strings of given length containing balanced parentheses

Given a positive number n, find all strings of length n containing balanced parentheses.

Find Lexicographically minimal string rotation

Lexicographically minimal string rotation or lexicographically least circular substring is the problem of finding the rotation of a string possessing the lowest lexicographical order of all such rotations.

Find all lexicographically next permutations of a string sorted in ascending order

Given a string sorted in ascending order, find all lexicographically next permutations of it.

Find all permutations of a string in C++ (Using Backtracking and STL)

In this post, we will see how to find all permutations of a string containing all distinct characters in C++.