- 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++
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
227 Views
Suppose we have an array A with n elements. There is a special type of an auction, which is called the second-price auction. In a regular auction, n bidders place a bid which is price a bidder ready to pay. The auction ends, when each bidder secretly informs the organizer of the auction price he is willing to pay. After that, the auction winner is the participant who offered the highest price. But here, he pay not the price he offers, but the highest price among the offers of other participants (the second-price auction). A[i] is the price offered by ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
220 Views
Suppose we have two numbers n and m. Amal has n candies and m friends. He wants to make a present with candies to each friend. Amal is planning to present all candies and he wants to do this in the most equal manner. He wants to choose such A[i], where A[i] is the number of candies in the i-th friend's present, the maximum A[i] differs from the least A[i] as little as possible. We have to find the array A.Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, we have to devise an ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
337 Views
Suppose we have a number n and two arrays A and B of different sizes. There are two mice: m1 and m2. We put n apples in front of them. We know which apples m1 likes. Similarly, we also know which apples m2 likes. We do not want any conflict between the mice (as they may like the same apple), so we decided to distribute the apples between the mice on our own. We are going to give some apples to m1 and some apples to m2. It doesn't matter how many apples each mouse gets but it is important ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
96 Views
Suppose we have an array A with n elements. In a university for each course there is the special group whose name equals the year of university entrance of corresponding course of students at the university. Each of students joins the group of his course and joins all groups for which the year of student's university entrance differs by no more than x years from the year of university entrance of this student. The value of x is not given, but it can be determined from the available data. A is a list of groups which the student Amal joined. ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
427 Views
Suppose we have a list of strings S with n numeric strings. Amal has n friends in a city. Amal knows phone numbers of all his friends: they are stored in S. All strings in S are of same length. Once Amal needed to figure out the city phone code. He assumed that the phone code of the city is the longest common prefix of all phone numbers of his friends. We have to find the length of the city phone code.Problem CategoryTo solve this problem, we need to manipulate strings. Strings in a programming language are a stream of ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
85 Views
Suppose we have a 2D matrix of characters of size n x m. Where '*' and '.' two types of characters are present. Only three '*'s are there, representing there are 3 robberies, and all other places are marked as '.'. A detective got an information that the fourth robbery will be committed in such cell, that all four robbed cells will form the vertices of some rectangle, parallel to the sides of the map. We have to find the cell.Problem CategoryAn array in the data structure is a finite collection of elements of a specific type. Arrays are used ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
109 Views
Suppose we have a string S where a decimal real number is given. There is a king called Amal, and his son Bimal is in a kingdom. There are other citizens also. They lived happily until great trouble came into the Kingdom. The monsters settled there. Most damage those strange monsters inflicted upon the kingdom was that they loved high precision numbers. As a result, the Kingdom healers had already had three appointments with the merchants who sell, exactly 0.273549107 potion barrels. To deal with the problem somehow, the King Amal issued an order obliging rounding up all numbers to ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
106 Views
Suppose we have an array A with n elements. There are n episodes of a TV series. They are numbered from 1 to n. We have watched episodes written in array A, but missed one. We have to find which episode we have missed.Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, we have to devise an algorithm first and to do that we have to study the particular problem in detail. A recursive approach can be used if there is a recurring appearance of the same problem over and over again; alternatively, we ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
145 Views
Suppose we have an array A with n elements and two values a and b. Amal and Bimal are two brothers. Their parents left them home alone and commissioned them to do n chores. Each chore has its complexity. The complexity of the i-th chore equals A[i]. Amal is older, he wants to take the chores with complexity larger than some value x (A[i] > x) to leave to Bimal the chores with complexity less than or equal to x (A[i] ≤ x). Amal will do exactly a number of chores and Bimal will do exactly b number of chores ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
894 Views
Suppose we have a string S. S is a password. If a password is complex, if it meets all of the following conditions −Password length is at least 5 characters;Password contains at least one uppercase letter;Password contains at least one lowercase letter;Password contains at least one digit.We have to check the quality of the password S.Problem CategoryTo solve this problem, we need to manipulate strings. Strings in a programming language are a stream of characters that are stored in a particular array-like data type. Several languages specify strings as a specific data type (eg. Java, C++, Python); and several other ... Read More