## Largest Component Size in a Graph Formed by Connecting Non-Co-Prime Nodes

Sonal Meenu Singh

Updated on 22-Aug-2023 17:12:55

12 Views

Introduction In this tutorial, we discuss the problem of finding the largest component size in a graph generated by connecting non-co-prime nodes through C++. Graphs are formed by nodes connected by edges. The components of the graph are a subset of values that form nodes. There is an array a[] ... Read More

## Reverse alternate k characters in a string

Sonal Meenu Singh

Updated on 18-Aug-2023 16:53:38

58 Views

Introduction In this tutorial, we implement examples using C++ programming logic to reverse the alternate k characters in an input string. We define the value of k to reverse the characters in a given string. K is the number of characters to be reversed. The value of k can be ... Read More

## Range Queries to find the Element having Maximum Digit Sum

Sonal Meenu Singh

Updated on 18-Aug-2023 16:48:43

35 Views

Introduction In this tutorial, we discuss the problem of range queries to find the element having Maximum Digit Sum in C++. To solve the problem, take an array of elements and some queries. The queries denote the indices of the array and using those queries find the array element with ... Read More

## Queries for the Count of Even Digit Sum Elements in the given Range using Segment Tree

Sonal Meenu Singh

Updated on 18-Aug-2023 16:45:44

22 Views

Introduction In this tutorial, we implement an approach in C++ to resolve queries for the count of even digit sum elements in the given range. We use a segment tree. To solve this task, we consider an array of elements with queries defining the range of the subarray. In that ... Read More

## Print Strings In Reverse Dictionary Order Using Trie

Sonal Meenu Singh

Updated on 18-Aug-2023 16:29:28

44 Views

Introduction This tutorial implements an approach to printing Strings In Reverse Dictionary Order Using Trie. Trie is a data structure with a tree representation. It is in ordered form and provides an efficient approach for string retrieval. It has nodes and edges like a tree data structure. To solve the ... Read More

## Number of Times the given String Occurs in the Array in the Range [l, r]

Sonal Meenu Singh

Updated on 18-Aug-2023 16:19:30

32 Views

Introduction In this tutorial, we implement examples using C++ to find the number of times an input string occurs in an array of the range [l, r]. Only lowercase alphabets are used in the string array to resolve this task. Different strings are stored in the string array and traversed ... Read More

## Minimum Number of Substrings of a String such that all are Power of 5

Sonal Meenu Singh

Updated on 18-Aug-2023 16:09:12

27 Views

Introduction In this tutorial, we implement 2 examples using C++ to find the minimum number of substrings in a given string. Those substrings are all powers of 5 that means, the substrings are the factors of the number 5. To implement the example, take an input binary string and generate ... Read More

## Minimum Cost to Modify a String

Sonal Meenu Singh

Updated on 18-Aug-2023 13:55:29

31 Views

Introduction In this tutorial, we use C++ programming concepts to implement examples to find the minimum cost to modify a string. String modification includes operations to change one string into another string. String operations include insertion, deletion, and substitution. We predefined the cost of each operation. You can choose the ... Read More

## Maximum Length Palindrome of a String that can be Created with Characters in Range L and R

Sonal Meenu Singh

Updated on 18-Aug-2023 13:54:04

32 Views

Introduction A palindrome is one that reads the same forward and backward. An example of a palindrome string is Mam. In this tutorial, we use C++ programming to find the maximum length palindrome of a string by predefining the range of characters. Our task is to find the ... Read More

## Longest substring of only 4’s from the first N Characters of the Infinite String

Sonal Meenu Singh

Updated on 18-Aug-2023 12:54:01

35 Views

Introduction In this tutorial, we implement an approach to find the longest substring of only 4 using the first N characters of the infinite string. Infinite string using 4 looks like this: “44444444……” and for this string we define the length of characters to consider for solving the task. To ... Read More