C++ Program to Find ith Largest Number from List Using Order-Statistic Algorithm

C++ Program to find the kth largest number from a given list using the Order-Statistic algorithm. Problem Description 1. Implements Order-Statistic tree. 2. It is an improvement in BST by adding two more key functions- rank() and select(). 3. The time complexity of Order-statistic tree generation is O(n+n*log(n)). 4. Once the tree is constructed, this … Read more

advertisement

C++ Program to Find kth Smallest Element in Array using Partitioning

C++ Program to find a Kth smallest element by the method of partitioning the array. Problem Description 1. Implement partitioning to find the Kth smallest number from a dataset of n element. 2. The time complexity of this algorithm is O(n*log(n)). Problem Solution 1. Take the input of the data set. 2. Use the partition … Read more

advertisement

C++ Program to Find the Mode of a Data Set

This is a C++ program to find the Mode in a Dataset. Problem Description 1. The mode is the maximum of the count of occurrence of the different data element. 2. This algorithm is beneficial for a large dataset with high repetition frequency. 3. The worst case time complexity of this algorithm is O(n^2). Problem … Read more

advertisement

C++ Program to Implement Alexander Bogomolny’s UnOrdered Permutation Algorithm

This is a C++ program to implement the Alexander Bogomolyn’s Unordered Permutation algorithm for elements from 1 to N. Problem Description 1. The Alexander Bogomolyn’s algorithm is to permute first ‘N’ natural numbers. 2. The time complexity of this algorithm is O(n!). Problem Solution 1. This algorithm takes N value. 2. It initializes the value … Read more

advertisement

C++ Program to Implement Heap’s Algorithm for Generating Permutations

This is a C++ to implement Heap’s Algorithm for the permutation of N numbers. Problem Description 1. This algorithm print the permutation using heap algorithm. 2. The time complexity of this algorithm is O(n!). Problem Solution 1. This algorithm takes the input of ‘N’ distinct numbers. 2. It fixes an element at the end of … Read more

advertisement

C++ Program to Generate a Sequence of N Characters for a Given Specific Case

This is a C++ Program to generate a sequence of n characters for a given specific case. Problem Description 1. This algorithm generates sequences of n characters from a specific sequence. 2. The time complexity of this algorithm is O(n). Problem Solution 1. This algorithm takes the input of the specific sequence. 2. It generates … Read more

advertisement

C++ Program to Generate All Possible Subsets using Gray Code Order

This is a C++ program to generate all subsets of a given set in the gray code order. Problem Description 1. This algorithm print all the possible combination of each length from the given array in gray code order. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the … Read more

advertisement

C++ Program to Generate All Possible Subsets using Lexicographic Order

This is a C++ program to generate all subsets of a given set in the lexicographic order. Problem Description 1. This algorithm print all the possible combination of each length from the given array in increasing order. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the input of … Read more

advertisement

C++ Program to Generate All Possible Subsets using Binary Counting Method

This is a C++ program to implement the binary counting method to generate subsets of a set. Problem Description 1. This algorithm print all the possible combination of each length from the given array using binary counting method. 2. The time complexity of this algorithm is O(n*(2^n)). Problem Solution 1. This algorithm takes the input … Read more

advertisement

C++ Program to Generate a Random Subset by Coin Flipping

This is a C++ program to generate a random subset by coin flipping. Problem Description 1. This algorithm prints a subset of the given array using coin flipping method. 2. The time complexity of this algorithm is O(n). Problem Solution 1. This algorithm takes the input of ‘n’ data element and prints a possible subset. … 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.