Skip to content

Tag Archives: Reverse

Given a linked list, write a function to reverse every k node (where k is an input to the function). Examples:   Inputs:  1->2->3->4->5->6->7->8->NULL, k =… Read More
Given an unsorted Singly Linked List consisting of N nodes that may contain duplicate elements, the task is to remove all but the last occurrence… Read More
Given a string S consisting of N characters of the English alphabet, the task is to check if the given string is a palindrome. If… Read More
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[] consisting of N positive integers, the task is to find the count of unique pairs (i, j) such that the sum… Read More