Skip to content

Tag Archives: lexicographic-ordering

C++ STL offers many utilities to solve basic common life problems. Comparing values are always necessary, but sometimes we need to compare the strings also.… Read More
Given a string s, make a list of all possible combinations of letters of a given string S. If there are two strings with the… Read More
C++ STL offer many utilities to solve basic common life problems. Comparing values are always necessary, but sometimes we need to compare the strings also.… Read More
Given a string of length m containing lowercase alphabets only. You have to find the n-th permutation of string lexicographically. Examples: Input : str[] =… Read More
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDADInput Constraint: 1 < n <… Read More
Rearrange the characters of the given string to form a lexicographically first palindromic string. If no such string exists display message “no palindromic string”. Examples:… Read More
Given an array arr[], find the lexicographically smallest array that can be obtained after performing at maximum of k consecutive swaps. Examples :   Input: arr[] =… Read More
You are given two strings. Now you have to print all longest common sub-sequences in lexicographical order?Examples:   Input : str1 = "abcabcaa", str2 = "acbacba"… Read More
Given a word, find lexicographically smaller permutation of it. For example, lexicographically smaller permutation of “4321” is “4312” and next smaller permutation of “4312” is… Read More
Given a word, find the lexicographically greater permutation of it. For example, lexicographically next permutation of “gfg” is “ggf” and next permutation of “acb” is… Read More
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD.Source: Google Written TestMore Examples:  Input:… Read More
Given a string, print all permutations of it in sorted order. For example, if the input string is “ABC”, then output should be “ABC, ACB,… Read More

Start Your Coding Journey Now!