- 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 7401 Articles for C++
127 Views
The problem statement includes printing the N-th centered octagonal number for some positive integer N, which will be given by the user. A centered octagonal number is a type of number which can be represented in a pattern of figures. Every centered octagonal number can be represented as a dot in the centre surrounded by the successive layers of an Octagon. An octagon is a type of polygon in geometry which has 8 sides in it. The successive layers of an octagon means that the first layer surrounding the dot in the centre will be an octagon, the second ... Read More
65 Views
The problem includes to print the N-th centered octadecagonal number, where N will be given as an input. A centered octadecagonal number is a type of figurative number which is represented as a dot in the centre surrounded by the successive layers of the octadecagon. An octadecagon is a polygon with 18 sides in it. The successive layers of the octadecagon are the first layer will be 18-sided polygon, the next will be 36-sided polygon and so on. The numbers can be better explained with the help of figures. The first number is represented as a dot in the ... Read More
77 Views
The problem statement says to print the N-th centered dodecahedral number for any positive value of N which will be the user input. A centered dodecahedral number is a number that can be represented in a particular pattern of figure. A dodecahedron is a three-dimensional figure in mathematics which has 12 flat faces. And a centered dodecahedral number is a number which can be represented in the form of a figure with a dot in the centre surrounded by the successive layers of the dodecahedron (12 faced 3-d structure). The successive layers of the dodecahedron says the first layer will ... Read More
57 Views
The problem statement includes printing of the N-th centered nonadecagonal number for any positive value of N. A centered nonadecagonal numbers are numbers which are represented in a particular pattern of figure. This number can be represented in a figure as a dot in the centre surrounded by the successive layers of the nonadecagon. A nonadecagon is a type of polygon in mathematics which has 19 sides in it. The successive layers of the nonadecagon suggests that the first layer surrounding the dot in the centre will be 19 sided polygon followed by 38 sided polygon and so ... Read More
99 Views
The problem statement includes printing the N-th centered cube number for some positive value of N, which will be the user input. A centered cube number is the number of points in a three-dimensional pattern created by a point surrounded by concentric cubical layers of points, with i^2 points on the square faces of the ith layer. It is equivalently the number of points in a body-centered cubic pattern within the cube with n + 1 points along each of its edges. You can refer to wikipedia for figurative representation of the centered cube number which will help in better ... Read More
108 Views
Minimum removals required such that a given string consists only of a pair of alternating characters is a common problem in computer science and is encountered frequently in applications involving string manipulation. In this tutorial, we will solve this problem using the C++ programming language. We will begin by explaining the problem statement in detail and discussing its importance in various real-world applications. Then, we will provide a step-by-step algorithm to solve this problem and demonstrate its implementation in C++. Finally, we will conclude with some insights into the time and space complexity of our solution ... Read More
98 Views
The minimum number of replacements done of the substring “01” with “110” to remove it completely is a common problem in string manipulation and optimization. In this tutorial, we delve into this problem and present an efficient solution using C++. The problem entails finding the minimum number of replacements required to transform a binary string by replacing all occurrences of the substring "01" with "110" while ensuring that the resulting string does not contain the substring "10". We provide a detailed explanation of the problem statement, present an algorithmic approach to solve it, and offer a ... Read More
121 Views
Finding the minimum distance between duplicates in a string is a frequently encountered problem in computer science. It involves finding the smallest distance between any two identical characters in a given string. For example, in the string "minimum distance, " the minimum distance between the two 'i's is two, as they occur at positions 1 and 3, respectively. This problem can be solved using different programming languages, including C++. In this tutorial, we will learn a C++ algorithm with implementation to efficiently solve this problem. So let's get into this and learn something new and exciting! Problem ... Read More
111 Views
The maximum score possible by removing substrings made up of a single distinct character is a well-known problem in the field of computer science and algorithm design. The problem statement involves finding the optimal solution to remove all the contiguous substrings from a binary string that contains only one type of character and score points for every removed substring of length K, where K can vary for each substring. This problem has various real-life applications, including text analysis and compression. In this tutorial, we will provide a solution to this problem using C++, and explain the logic behind ... Read More
82 Views
Maximizing time by replacing ‘_’ in a given 24-hour format time is a problem that involves calculating the maximum possible time by replacing the missing digits in a given time in a 24-hour format. The task is to find the maximum time possible by replacing the characters ‘’ with any digit. In this tutorial, we will discuss how to solve this problem using the C++ programming language. We will provide a step-by-step explanation of the algorithm used to calculate the maximum possible time, along with the C++ code to implement the algorithm. Additionally, we will include test examples ... Read More
To Continue Learning Please Login
Login with Google