# C++ Programming Examples on Combinatorial Problems & Algorithms

## 1. C++ Programming examples on “Sorting”

Sorting is ordering a list of objects. There are two types of sorting. If the number of objects is small enough to fits into the main memory is called internal sorting. If the number of objects is so large that some of them reside on external storage during the sort is called external sorting. This section contains C++ programs on implementing internal sorting algorithms like bucket sort, bubble sort, insertion sort, selection sort, heapsort and mergesort. this section also provides implementation on other sorting like radix, stooge, shaker, quick and shell sort.

## 2. C++ Programming examples on “Searching”

Searching is an operation or a technique that helps to finds the place of a given element or value in the list. Most commonly used searching technique are linear search or sequential search and binary search. It performs searching using self-organizing lists, reference and uniform binary search, This section contain C++ programs that implement searching algorithms like binary search interpolation algorithms. This section also contains a program to find the largest element, minimum and maximum number in an array or sequence using linear and binary search.

## 3. C++ Programming examples on ” Median and Selection”

Selection sort algorithm sort data by comparing one element to every other element and decide its position. Binary search is an algorithm used to search for an element in a sorted array. In this algorithm the targeted element is compared with middle element. Naive string matching algorithm is used to find all the occurrence of a given pattern in a given string. The programs compute median and mode of different elements in an array, implementation of quick sort with given complexity constraint, This section contains C++ programs to find the largest element, smallest number and median using binary search approach and naive method.

## 4. C++ Programming examples on “Generating Permutations and Combinations”

Heap’s algorithm generates all possible permutations of n objects. Matrix Multiplication multiplies two matrices and prints the result. This section contains C++ programs to compute combinations using factorials, recurrence relation for nCr and matrix multiplication, implementation of heaps and alexander bogomolny’s unordered permutation algorithm. program to generate all possible combinations of lists, program to find number of permutations in a given string.

## 5. C++ Programming examples on “Generating Subsets”

A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in dictionaries. Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit. This section contains C++ programs to generate subsets in gray code and lexico graphic order, random and all possible subsets by coin flipping and k elements, implementation of binary counting method.

## 6. C++ Programming examples on “Generating Partitions”

The C++ programs in this section generates random and set partitions, program to find the number of ways to partition a word to check word is palindrome and integer partition for a specific case.

## 7. C++ Programming examples on “Generating Graphs”

Random Edge Selection algorithm takes the input of the number of vertexes and edges of the graph. It connects vertexes randomly and generates cyclic, acyclic or disconnected undirected graphs. Random Edge Generation algorithm generates a undirected random graph for some random number of edges and vertexes. Adjacency Matrix is a 2D array of size V x V where V is the number of vertices in a graph. An adjacency list represents a graph as an array of linked list. This section contains C++ programs on generating graphs using adjacency matrix, incidence matrix, 2d arrays, linked lists, adjacency and incidence list, random undirected graph and random directed acyclic graph, program to create prufer code for trees and random graph using random edge generation.

## 8. C++ Programming examples on “Other”

This section contains C++ program to solve hanoi tower problem using binary value.

C++ program to Solve Tower of Hanoi Problem using Binary Value |

**Here’s the list of 1000 C++ Algorithms, Problems & Programming Examples.**