- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 7346 Articles for C++
![Sakshi Koshta](https://www.tutorialspoint.com/assets/profiles/652652/profile/60_3316011-1683712915.jpeg)
571 Views
Determining the number of unique strings that can be obtained by performing a set of given operations on a string is a common challenge in computer science and mathematics. Several operations, including character deletion, swapping, or string reversal, can be carried out on the string. The objective is to calculate the total count of different output strings achievable through these operations irrespective of their order. The problem-solving techniques applied for this task comprise dynamic programming, recursion, and combinatorics among others—depending upon the nature of specific operations undertaken. Methods To count the distinct possible strings after performing given operations, one ... Read More
![Sakshi Koshta](https://www.tutorialspoint.com/assets/profiles/652652/profile/60_3316011-1683712915.jpeg)
128 Views
A monotonous substring is a contiguous substring of given string containing characters whose values are all strictly increasing or strictly decreasing. A monotonous substring is a string sequence that either strictly increases or strictly decreases in value. Method Dynamic Programming Backtracking Method 1: Dynamic Programming One technique is to apply dynamic programming to construct table of sub problems, here each item (i, j) in table denotes whether there exists a permutation of the substring S[i...j] that does not contain any monotonous substring. When i=j, the substring comprises only one character and is hence trivially monotonous. ... Read More
![Sakshi Koshta](https://www.tutorialspoint.com/assets/profiles/652652/profile/60_3316011-1683712915.jpeg)
87 Views
A binary string is made up of a succession of binary numbers, also known as bits, that are either 0 or 1. It is a method of encoding data that uses only two numbers for computer applications where data is stored and processed using electronic circuits that can only recognise two states. In computer programming, binary strings are frequently used to represent data in way that is simple for electronic circuits to handle, such as numbers, text, and images. Method Method 1. Dynamic Programming Method 2. Greedy Approach Method 1: Dynamic Programming To tackle this difficulty, we can employ ... Read More
![Sakshi Koshta](https://www.tutorialspoint.com/assets/profiles/652652/profile/60_3316011-1683712915.jpeg)
4K+ Views
An Indian passport number is special alphanumeric code that Indian government issues to owner of an Indian passport. The passport number is made up of 8–12 characters, that may include both letters and digits. The first two characters of passport number indicate type of passport, such as P for an ordinary passport, D for a diplomatic passport, and S for an official passport. The next two characters stand for the code of the organization that issues passports, and they are followed by string of numbers that serve as passport holder's special identification. Indian passport numbers are normally printed on the ... Read More
![Sakshi Koshta](https://www.tutorialspoint.com/assets/profiles/652652/profile/60_3316011-1683712915.jpeg)
105 Views
Let's first understand the meaning of neighbour cells in matrices. To determine how each component fits into your two-dimensional matrix structure visualize each enclosed unit as being encompassed by almost eight adjacent elements positioned across/from them both diagonal directions in addition to vertical/horizontal ones. An example observation can be made about lattice size - the smallest circular enclosure in this design has nine components.(from left-to-right & up-to-down)Cell [row=9, col=8] -- within reach from [row=8, col=7], ...[row=10, col=8], and so forth. This intricate connection network links these adjacent components where they share edges or corners; creating a well-defined matrix structure stepping ... Read More
![Thanweera Nourin A V](https://www.tutorialspoint.com/assets/profiles/687554/profile/60_3473688-1694414827.jpeg)
507 Views
The aim of this article is to implement a program to print the number of camel case character present in a given string. As you all know, a string is a collection of characters. Now let us see what camel case letters are. Programming languages like Java utilise a naming style called camel case. That is, It includes entering multi-word identities without spaces or underscores, having the initial word in lowercase with successive words in uppercase. Code written in this manner is easier to read and understand. The inner uppercase letters, which resemble camel humps, are what give the name ... Read More
![Thanweera Nourin A V](https://www.tutorialspoint.com/assets/profiles/687554/profile/60_3473688-1694414827.jpeg)
809 Views
The challenge is to display the top five probable plain texts which could be decrypted from the supplied monoalphabetic cypher utilizing the letter frequency attack from a string Str with size K representing the given monoalphabetic cypher. Let us see what exactly is frequency attack. The very foundation for frequency analysis is the certainty that specific letters and letter combinations appear with varied frequencies all through any given section of written language. Additionally, matter-of-factly every sample of that language shares a common pattern in the distribution of letters. To make it more clear, The English alphabet has 26 letters, ... Read More
![Thanweera Nourin A V](https://www.tutorialspoint.com/assets/profiles/687554/profile/60_3473688-1694414827.jpeg)
57 Views
The aim of this article is to implement a program to find minimum steps to determine the subsequence with max 1s based on given conditions. So as we all know, a one-dimensional array containing characters that is terminated by a null can be used to define a string. Given is a string Str of length K, wherein K is always even, and contains the characters "0, " "1, " and "?" Divide the string to two separate strings, let's call them Str1 and Str2, each of which is going to include the characters at the even values of Str and ... Read More
![Thanweera Nourin A V](https://www.tutorialspoint.com/assets/profiles/687554/profile/60_3473688-1694414827.jpeg)
57 Views
The aim here is to determine whether it would be feasible to make all of the strings identical in any amount of operations provided an array Str of strings with size n. Any element can be taken out of the string and put back in at any point in the same or another string all in one action. Return "Yes" if the strings are able to be made to equal one another, and "No" if not, along with the fewest number of operations necessary. Problem Statement Implement a program to minimize count of repositioning of characters to make all given ... Read More
![Thanweera Nourin A V](https://www.tutorialspoint.com/assets/profiles/687554/profile/60_3473688-1694414827.jpeg)
133 Views
The aim of this article is to implement a program to maximize the sum of lengths of a pair of strings with no common characters from a given array. By definition, a string is a collection of characters. Problem Statement Implement a program to maximize the sum of lengths of a pair of strings with no common characters from a given array. Sample Example 1 Let us consider the Input array: a[] = [“efgh”, “hat”, “fto”, “car”, “wxyz”, “fan”] Output obtained: 8 Explanation There are no characters in the strings "abcd" and "wxyz" in common. As a ... Read More