
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7197 Articles for C++

168 Views
In this tutorial, we delve into the problem of dividing a given string into two non-empty subsets, where the first subset is the reverse of the second subset. We aim to provide an efficient solution to count the number of ways to achieve such partitions. By leveraging the power of the C++ programming language, we present a solution that utilizes bitmasking and string manipulation techniques to iterate through all possible partitions and validate them against the given condition. We will explore the step-by-step implementation of the solution, discussing the algorithm and code structure. Additionally, we will provide a ... Read More

383 Views
Count possible decoding of a given digit sequence with hidden characters is a fascinating problem in the realm of string decoding. In this tutorial, we delve into the challenge of decoding a sequence of digits that may contain hidden characters denoted by asterisks ('*'). The task at hand is to determine the number of ways these hidden characters can be decoded, taking into account a specific mapping of letters from A to Z to the digits 1 to 26. We present an efficient solution using the power of C++ programming language and dynamic programming techniques. By ... Read More

154 Views
In this tutorial, we will explore a problem statement that involves checking whether a string, formed by combining the first X characters and the last X characters of a given string, is a palindrome or not. A palindrome refers to a sequence of characters that remain unchanged when reading both forwards and backwards. The task is to determine if the resulting combined string, derived from the specified characters at the beginning and end of the original string, exhibits palindrome properties. To accomplish this, we will delve into an effective solution using the C++ programming language. By breaking ... Read More

279 Views
Check if a given pattern exists in a given string or not including wild cards * and . is a common problem in computer science and programming. In this problem, we are given a string (text) and a pattern, which can contain wildcard characters '*' and '.', and we need to check if the pattern matches the text or not. This problem is encountered in a wide range of applications, such as search engines, file systems, and network protocols. In this tutorial, we will discuss a simple and efficient solution to this problem using C++. We will start ... Read More

113 Views
Checking if a permutation of S2 can be obtained by adding or removing characters from S1 is a common problem in computer science. This problem is of great significance in various domains, including data processing, text analysis, and pattern recognition. In this tutorial, we will be presenting a solution to this problem using C++ programming language. The approach involves analyzing the characteristics of S1 and S2 to establish whether S2 can be rearranged to form a permutation of S1. We will be providing the C++ code for this approach along with explanations to help readers understand the problem ... Read More

177 Views
Partitioning a string into palindromic strings of at least length 2 with every character present in a single string is a challenging problem in computer science. The task is to take a string and divide it into multiple substrings, each consisting of at least two characters and containing every character of the original string only once. The objective is to determine if each substring is a palindrome or not. In this tutorial, we will provide a solution to this problem using C++. We will discuss the algorithm and the code implementation step by step, along with providing two test ... Read More

90 Views
Modifying string by sorting characters after the removal of characters whose frequency is not equal to the power of 2 is a popular problem in the field of computer programming, particularly in the context of competitive programming. The problem involves taking a string as input and modifying it by removing characters whose frequency is not a power of 2, and then sorting the remaining characters in lexicographically increasing order. In this tutorial, we will provide a detailed solution to this problem using the C++ programming language. We will start by discussing the problem statement in greater detail, exploring the ... Read More

175 Views
Modifying a string by replacing characters with alphabets whose distance from that character is equal to its frequency is an intriguing problem that involves manipulating strings in a unique way. The task is to take a given string as input and replace each character in the string with an alphabet that is at a distance equal to the frequency of that character in the string. For instance, if the character 'a' appears three times in the string, it would be replaced by an alphabet that is three positions away from 'a' in the English alphabet. This problem presents an interesting ... Read More

224 Views
Longest Common Subsequence (LCS) is a classic problem in computer science that involves finding the longest subsequence that is present in two given strings. In this tutorial, we will explore a unique approach to solving this problem, which involves repeatedly swapping characters between the two strings until we find the LCS. This approach involves a bit of creativity and is not commonly used, but it can be useful in certain situations. We will be using the C++ programming language to implement this solution, and we will provide a step-by-step guide on how to do so. So, let's dive in ... Read More

131 Views
Checking if any pair of consecutive 1s can be separated by at most M 0s by circular rotation of a Binary String is a common problem in computer programming and binary manipulation. The task is to determine whether a given binary string can be rotated in a circular manner such that any pair of consecutive 1s in the string can be separated by at most M 0s. This problem arises in various applications, such as image processing, data compression, and information retrieval. In this tutorial, we will delve into the intricacies of this problem statement and provide a solution ... Read More