Skip to content

Tag Archives: Reverse

Given a stack S, the task is to reverse the stack S using two additional stacks. Example: Input: S={1, 2, 3, 4, 5}Output: 5 4… Read More
Given a Stack consisting of N elements, the task is to reverse the Stack using an extra stack. Examples: Input: stack = {1, 2, 3,… Read More
Given a string S consisting of N lowercase characters, the task is to find the starting and the ending indices ( 0-based indexing ) of… Read More
Given a string S consisting of N characters and positive integer K, the task is to check if there exist any (K + 1) strings… Read More
Given a string S representing a sentence, the task is to reverse the order of all palindromic words present in the sentence. Examples: Input: S… Read More
Given an integer N, the task is to find the absolute difference between the number of set bits present in the number N and in… Read More
Given three positive integers L, R, and K, the task is to find the largest group of palindromic numbers from the range [L, R] such… Read More
Given a XOR Linked List and a positive integer K, the task is to reverse the last K nodes in the given XOR linked list.… Read More
Given an array Q[][] consisting of N queries of the form {L, R}, the task for each query is to find the total count of… Read More
Given a binary tree consisting of N nodes, the task is to check if the nodes in the top view of a Binary Tree forms… Read More
Given a string S of length N, the task is to find the lexicographically smallest K-length subsequence from the string S (where K < N). … Read More
Given an array arr[] of size N, the task is to find the lexicographically largest permutation array by reversing any suffix subarrays from the array.… Read More
Given a Binary Tree with each node representing an alphabet, the task is to find lexicographically smallest palindromic root to leaf path. If no palindromic… Read More
Prerequisite: Switch Statement in C/C++, Functions in C/C++, Loops in C and C++, C/C++ do-while loop with Examples Write a menu-driven program to perform below… Read More