C++ Program to Generate All Possible Subsets

This is a C++ program to generate all possible subsets with exactly k elements in each subset. Problem Description 1. This algorithm print all the possible combination of each length from the given array. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the input of ‘n’ data element … Read more

advertisement

C++ Program to Generate All Possible Combinations

This is a C++ program to generate all possible combinations out of a,b,c,d,e. Problem Description 1. This algorithm print all the possible combination of each length from the given array. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the input of ‘n’ data element and prints all possible … Read more

advertisement

C++ Program to Find the Number of Ways to Write a Number as the Sum of Numbers Smaller than Itself

This is a C++ program to find the number of ways to write a number as the sum of numbers smaller than itself. Problem Description 1. This algorithm counts the partition of the given number. 2. There is no straight method to count a total number of the partition so we need to generate and … Read more

advertisement

C++ Program to Generate All Pairs of Subsets whose Union Make the Set

This is a C++ program to generate all pairs of subsets whose union make the set. Problem Description 1. This algorithm generates all pairs of subsets whose union make the set. 2. The time complexity of this algorithm is O(n*2^n). Problem Solution 1. This algorithm takes the input of ‘n’ data element and prints unique … Read more

advertisement

C++ Program to Generate All the Set Partitions of n Numbers Beginning from 1 and so on

This is a C++ program to generate all the set partitions of n numbers beginning from 1 and so on. Problem Description 1. This algorithm generates all the possible partition can be generated by breaking the given integer value. 2. The time complexity of this algorithm is O(n*n!). Problem Solution 1. This algorithm takes the … Read more

advertisement

C++ Program to Generate Random Partition from Given Set

This is a C++ program to generate random partition out of a given set of numbers or characters. Problem Description 1. This algorithm generates a random partition of the given set of characters or integers. 2. The time complexity of this algorithm is O(n). Problem Solution 1. This algorithm takes the input of a set … Read more

advertisement

C++ Program to Generate All Possible Combinations of a Given List of Numbers

This is a C++ program to generate all possible combinations of given list of numbers. Problem Description 1. This algorithm print all the possible combination of each length from the given array. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the input of ‘n’ data element and prints … Read more

advertisement

C++ Program to Perform Integer Partition for a Specific Case

This is a C++ program to perform integer partition for a specific case. Problem Description 1. This algorithm generates all the possible partition can be generated by breaking the given integer value. 2. The time complexity of this algorithm is O(n!). Problem Solution 1. This algorithm takes the input of a natural number and prints … Read more

advertisement

C++ Program to Compute Combinations using Factorials

This is a C++ to compute combinations using factorials. Problem Description 1. This algorithm prints a total number of combination possible for given n and r value. 2. The time complexity of this algorithm is O(n). Problem Solution 1. This algorithm takes the input of n and r value. 2. Print the result using ( … Read more

advertisement

C++ Program to Compute Combinations using Matrix Multiplication

This is a C++ program to compute combinations using matrix multiplication. Problem Description 1. This algorithm computes the combination using matrix multiplication method. 2. The time complexity to compute this is O(n*n*n). 3. This algorithm is very expensive to compute a combination. Problem Solution 1. This algorithm computes the combination(nCr) for the input of n … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.