Sunidhi Bansal has Published 1101 Articles

Recursive function to do substring search in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 08:18:19

1K+ Views

Given two strings Str and subStr as input. The goal is to find whether text present in subStr exists in Str as substring or not. The string X is called a substring of Y if whole X is present in Y at least once. We will use a recursive approach ... Read More

C++ Program Recursive Insertion Sort

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 08:14:39

861 Views

Insertion Sort is one of the sorting algorithms used to sort data by inserting elements like a deck of cards. All the elements are arranged from left to right then considering the first one as already sorted, insert rest to the sorted list on the left. Each element is compared ... Read More

Recursive function to check if a string is palindrome in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 08:09:17

5K+ Views

We are given a string Str as input. The goal is to find if the input string is a palindrome word or not using a recursive function. Palindrome strings are those strings that when read from front or end form the same word. The strings of length 0 are considered ... Read More

C Program for Recursive Bubble Sort

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:58:22

7K+ Views

Bubble Sort is one of the simplest sorting algorithms used to sort data by comparing the adjacent elements. All the elements are compared in phases. The first phase places the largest value at the end, the second phase places the second largest element at the second last position and so ... Read More

Rearrange the given source code in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:37:58

247 Views

We are given a string type variable, let's say, str which will be used to store the source code then calculate the size of the string and pass it to the function. The task is to rearrange the given source code and then print the result.Let us see various input ... Read More

Rearrange the string to maximize the number of palindromic substrings in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:15:32

203 Views

We are given with a string ‘str’ of any given length. The task is to rearrange the characters in such a manner that there will be maximum substrings that will be a palindrome string without adding or removing a character from the given input string. Palindrome string is the one ... Read More

Rearrangement of a number which is also divisible by it in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:13:10

249 Views

We are given an integer type number, let's say, number. The task is to rearrange number digit’s in such a manner that a number formed after rearrangement is also divisible by the given number i.e. ’number’.Let us see various input output scenarios for this −Input − int number = 100035Output − Rearrangement ... Read More

Rearrange characters to form palindrome if possible in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:09:53

791 Views

We are given with a string ‘str’ of any given length. The task is to rearrange the characters in such a manner that the output will be a palindrome string without adding or removing a character from the given input string. Palindrome string is the one in which the characters ... Read More

Rearrange Odd and Even values in Alternate Fashion in Ascending Order in C+=+

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 07:06:34

1K+ Views

We are given an integer type array containing both positive and negative numbers, let's say, arr[] of any given size. The task is to rearrange an array in such a manner that when the lowest element in an array is odd then elements of an array will be rearranged in ... Read More

Rearrange first N numbers to make them at K distance in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 02-Nov-2021 06:57:56

59 Views

We are given integer variables, let's say, N and K. The task is to firstly calculate the permutation of N and then rearrange the permutation in such a manner that it will be K distance from every element.Let us see various input output scenarios for this −Input − int n = ... Read More

Previous 1 ... 4 5 6 7 8 ... 111 Next
Advertisements