
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++

212 Views
Suppose we have an array A with n elements. We can make another array consisting of n copies of the old array, added elements back-to-back. We have to find the the length of the new array's longest increasing subsequence? We know that a sequence p is a subsequence of an array b if p can be obtained from b by removing zero or more elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.Problem CategoryAn array in the data structure is a finite collection of elements of a ... Read More

767 Views
Suppose we have a number n. A number is a positive integer n, and that said to be an ordinary number if in the decimal notation all its digits are the same. We have to count the number of ordinary numbers in range 1 to n.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; ... Read More

266 Views
Suppose we have an array A with 2n number of elements. We know a permutation of first n natural numbers is a set of numbers where 1 to n are stored and they are ordered in an arbitrary order. in the array A, there are two permutations of size n are merged together. When they are merged the relative order of the elements remains unchanged. So if a permutation p is like p = [3, 1, 2] some possible results are: [3, 1, 2, 3, 1, 2], [3, 3, 1, 1, 2, 2], [3, 1, 3, 1, 2, 2]. The ... Read More

301 Views
Suppose we have an array A with n elements. Amal and Bimal received n candies from their parents. Each candy weighs either 1 gram or 2 grams. They want to divide all candies among themselves fairly so that their total candies weight is same. We have to check whether we can do that or not. (We can not divide a candy into halves).Problem CategoryThe above-mentioned problem can be solved by applying Greedy problem-solving techniques. The greedy algorithm techniques are types of algorithms where the current best solution is chosen instead of going through all possible solutions. Greedy algorithm techniques are ... Read More

187 Views
Suppose we have an array A with n elements. There are n athletes in a game. They are numbered from 1 to n and arranged in left to right order. The strength of each athlete i is A[i]. We want to split all athletes into two teams. Each team must have at least one athlete, and each athlete must be exactly in one team. We want the strongest athlete from the first team to differ as little as possible from the weakest athlete from the second team. We have to find the minimum difference between their strength as mentioned above.Problem ... Read More

1K+ Views
Suppose we have two arrays A and B of size n each. There are n gifts and we want to give them to some children. The ith gift has A[i] candies and B[i] oranges. During one move, we can choose some gift and do one of the following operations −Take out exactly one candy from this gift (if available);Take out exactly one orange from this gift (if available);Take out exactly one candy and exactly one orange from this gift (if available).All gifts should be equal. This means that after some sequence of moves the following two conditions should be satisfied: ... Read More

323 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

318 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

433 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

171 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