C/C++ Programs Last Updated : 21 Aug, 2025 Comments Improve Suggest changes 4 Likes Like Report sArray C/C++ ProgramsC Program to find sum of elements in a given arrayC program to find largest element in an arrayRecursive C program to linearly search an element in a given arrayC program to multiply two matricesC/C++ Program for Given an array A[] and a number x, check for pair in A[] with sum as xC/C++ Program for Majority ElementC/C++ Program for Find the Number Occurring Odd Number of TimesC/C++ Program for Largest Sum Contiguous SubarrayC/C++ Program for Find the Missing NumberC/C++ Program for Search an element in a sorted and pivoted arrayC/C++ Program for Merge an array of size n into another array of size m+nC/C++ Program for Median of two sorted arraysC/C++ Program for Write a program to reverse an arrayC/C++ Program for Program for array rotationC/C++ Program for Reversal algorithm for array rotationC/C++ Program for Block swap algorithm for array rotationC/C++ Program for Maximum sum such that no two elements are adjacentC/C++ Program for Leaders in an arrayC/C++ Program for Sort elements by frequency | Set 1C/C++ Program for Count Inversions in an arrayC/C++ Program for Two elements whose sum is closest to zeroC/C++ Program for Find the smallest and second smallest element in an arrayC/C++ Program for Check for Majority Element in a sorted arrayC/C++ Program for Maximum and minimum of an array using minimum number of comparisonsC/C++ Program for Segregate 0s and 1s in an arrayC/C++ Program for k largest(or smallest) elements in an array | added Min Heap methodC/C++ Program for Maximum size square sub-matrix with all 1sC/C++ Program for Maximum difference between two elements such that larger element appears after the smaller numberC/C++ Program for Union and Intersection of two sorted arraysC/C++ Program for Floor and Ceiling in a sorted arrayC/C++ Program for A Product Array PuzzleC/C++ Program for Segregate Even and Odd numbersC/C++ Program for Find the two repeating elements in a given arrayC/C++ Program for Sort an array of 0s, 1s and 2sC/C++ Program for Find the Minimum length Unsorted Subarray, sorting which makes the complete array sortedC/C++ Program for Find duplicates in O(n) time and O(1) extra spaceC/C++ Program for Equilibrium index of an arrayC/C++ Program for Which sorting algorithm makes minimum number of memory writes?C/C++ Program for Turn an image by 90 degreeC/C++ Program for Search in a row wise and column wise sorted matrixC/C++ Program for Next Greater ElementC/C++ Program for Check if array elements are consecutive | Added Method 3C/C++ Program for Find the smallest missing numberC/C++ Program for Count the number of occurrences in a sorted arrayC/C++ Program for Binary SearchC/C++ Program for Selection SortC/C++ Program for Bubble SortC/C++ Program for Insertion SortC/C++ Program for Merge SortC/C++ Program for Heap SortC/C++ Program for QuickSortC/C++ Program for Given an array arr[], find the maximum j – i such that arr[j] > arr[i]C/C++ Program for Maximum of all subarrays of size k (Added a O(n) method)C/C++ Program for Find whether an array is subset of another array | Added Method 3C/C++ Program for Find the minimum distance between two numbersC/C++ Program for Find the repeating and the missing | Added 3 new methodsC/C++ Program for Print a given matrix in spiral formC/C++ Program for A Boolean Matrix QuestionC/C++ Program for Median in a stream of integers (running integers)C/C++ Program for Find a Fixed Point in a given arrayC/C++ Program for Maximum Length Bitonic SubarrayC/C++ Program for Find the maximum element in an array which is first increasing and then decreasingC/C++ Program for Count smaller elements on right sideC/C++ Program for Minimum number of jumps to reach endC/C++ Program for Implement two stacks in an arrayC/C++ Program for Find subarray with given sumC/C++ Program for Dynamic Programming | Set 14 (Maximum Sum Increasing Subsequence)C/C++ Program for Longest Monotonically Increasing Subsequence Size (N log N)C/C++ Program for Find a triplet that sum to a given valueC/C++ Program for Find the smallest positive number missing from an unsorted arrayC/C++ Program for Find the two numbers with odd occurrences in an unsorted arrayC/C++ Program for The Celebrity ProblemC/C++ Program for Dynamic Programming | Set 15 (Longest Bitonic Subsequence)C/C++ Program for Find a sorted subsequence of size 3 in linear timeC/C++ Program for Largest subarray with equal number of 0s and 1sC/C++ Program for Dynamic Programming | Set 18 (Partition problem)C/C++ Program for Maximum Product SubarrayC/C++ Program for Find a pair with the given differenceC/C++ Program for Replace every element with the next greatestC/C++ Program for Dynamic Programming | Set 20 (Maximum Length Chain of Pairs)C/C++ Program for Find four elements that sum to a given value | Set 1 (n^3 solution)C/C++ Program for Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)C/C++ Program for Sort a nearly sorted (or K sorted) arrayC/C++ Program for Maximum circular subarray sumC/C++ Program for Find the row with maximum number of 1sC/C++ Program for Median of two sorted arrays of different sizesC/C++ Program for Print unique rows in a given boolean matrixC/C++ Program for Shuffle a given arrayC/C++ Program for Count the number of possible trianglesC/C++ Program for Iterative Quick SortC/C++ Program for Inplace M x N size matrix transpose | UpdatedC/C++ Program for Find the number of islandsC/C++ Program for Construction of Longest Monotonically Increasing Subsequence (N log N)C/C++ Program for Find the first circular tour that visits all petrol pumpsC/C++ Program for Arrange given numbers to form the biggest numberC/C++ Program for Dynamic Programming | Set 27 (Maximum sum rectangle in a 2D matrix)C/C++ Program for Pancake sortingC/C++ Program for A Pancake Sorting ProblemC/C++ Program for Tug of WarC/C++ Program for Print Matrix DiagonallyC/C++ Program for Divide and Conquer | Set 3 (Maximum Subarray Sum)C/C++ Program for Counting SortC/C++ Program for Merge Overlapping IntervalsC/C++ Program for Find the maximum repeating number in O(n) time and O(1) extra spaceC/C++ Program for Stock Buy Sell to Maximize ProfitC/C++ Program for Rearrange positive and negative numbers in O(n) time and O(1) extra spaceC/C++ Program for Sort elements by frequency | Set 2C/C++ Program for Find a peak elementC/C++ Program for Print all possible combinations of r elements in a given array of size nC/C++ Program for Given an array of of size n and a number k, find all elements that appear more than n/k timesC/C++ Program for Find the point where a monotonically increasing function becomes positive first timeC/C++ Program for Find the Increasing subsequence of length three with maximum productC/C++ Program for Find the minimum element in a sorted and rotated arrayC/C++ Program for Stable Marriage ProblemC/C++ Program for Merge k sorted arrays | Set 1C/C++ Program for Radix SortC/C++ Program for Move all zeroes to end of arrayC/C++ Program for Find number of pairs such that x^y > y^xC/C++ Program for Count all distinct pairs with difference equal to kC/C++ Program for Count all possible paths from top left to bottom right of a mXn matrixC/C++ Program for Suffix Array | Set 1 (Introduction)C/C++ Program for Rearrange an array so that arr[i] becomes arr[arr[i]] with O(1) extra spaceC/C++ Program for Sort n numbers in range from 0 to n^2 – 1 in linear timeC/C++ Program for Count all possible groups of size 2 or 3 that have sum as multiple of 3Matrix C/C++ ProgramsC Program to check if two given matrices are identicalC program to find transpose of a matrixC program for subtraction of matricesC program for addition of two matricesC program to multiply two matricesC/C++ Program for Print a given matrix in spiral formC/C++ Program for A Boolean Matrix QuestionC/C++ Program for Print Matrix DiagonallyC Program to find the number of islandsC Program to find maximum size square sub-matrix with all 1sC/C++ program for the celebrity problemC/C++ Program for Print a given matrix in spiral formString C/C++ ProgramsC program to swap two StringsC Program to Check if a Given String is PalindromeC Program to Sort an array of names or stringsC/C++ Program for Return maximum occurring character in the input stringC/C++ Program for Remove all duplicates from the input string.C/C++ Program for Print all the duplicates in the input string.C/C++ Program for Remove characters from the first string which are present in the second stringC/C++ Program for A Program to check if strings are rotations of each other or notC/C++ Program for Print reverse of a string using recursionC/C++ Program for Write a C program to print all permutations of a given stringC/C++ Program for Divide a string in N equal partsC/C++ Program for Given a string, find its first non-repeating characterC/C++ Program for Print list items containing all characters of a given wordC/C++ Program for Reverse words in a given stringC/C++ Program for Run Length EncodingC/C++ Program for Find the smallest window in a string containing all characters of another stringC/C++ Program for Searching for Patterns | Set 1 (Naive Pattern Searching)C/C++ Program for Searching for Patterns | Set 2 (KMP Algorithm)C/C++ Program for Searching for Patterns | Set 3 (Rabin-Karp Algorithm)C/C++ Program for Searching for Patterns | Set 4 (A Naive Pattern Searching Question)C/C++ Program for Length of the longest substring without repeating charactersC/C++ Program for Print all permutations with repetition of charactersC/C++ Program for Print all interleavings of given two stringsC/C++ Program for Check whether a given string is an interleaving of two other given stringsC/C++ Program for Check whether two strings are anagram of each otherC/C++ Program for Searching for Patterns | Set 5 (Finite Automata)C/C++ Program for Pattern Searching | Set 6 (Efficient Construction of Finite Automata)C/C++ Program for Pattern Searching | Set 7 (Boyer Moore Algorithm – Bad Character Heuristic)C/C++ Program for Dynamic Programming | Set 17 (Palindrome Partitioning)C/C++ Program for Lexicographic rank of a stringC/C++ Program for Print all permutations in sorted (lexicographic) orderC/C++ Program for Longest Palindromic Substring | Set 1C/C++ Program for An in-place algorithm for String TransformationC/C++ Program for Longest Palindromic Substring | Set 2C/C++ Program for Given a sequence of words, print all anagrams together | Set 1C/C++ Program for Given a sequence of words, print all anagrams together | Set 2C/C++ Program for Count words in a given stringC/C++ Program for String matching where one string contains wildcard charactersC/C++ Program for Write your own atoi()C/C++ Program for Dynamic Programming | Set 29 (Longest Common Substring)C/C++ Program for Remove “b” and “ac” from a given stringC/C++ Program for Dynamic Programming | Set 33 (Find if a string is interleaved of two other strings)C/C++ Program for Find the first non-repeating character from a stream of charactersC/C++ Program for Recursively remove all adjacent duplicatesC/C++ Program for Rearrange a string so that all same characters become d distance awayLinked List C/C++ Programs:C/C++ Program for Introduction to Linked ListC/C++ Program for Linked List InsertionC/C++ Program for Write a function to get Nth node in a Linked ListC/C++ Program for Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?C/C++ Program to print the middle of a given linked listC/C++ Program for Nth node from the end of a Linked ListC/C++ Program to delete a Linked ListC/C++ Program to counts the number of times a given int occurs in a Linked ListC/C++ Program for Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?C/C++ Program to reverse a linked listC/C++ Program to detect loop in a linked listC/C++ Program to check if a singly linked list is palindromeC/C++ Program The Great Tree-List Recursion Problem.C/C++ Program to Copy a linked list with next and arbit pointerC/C++ Program for Given a linked list which is sorted, how will you insert in sorted wayC/C++ Program for Write a function to get the intersection point of two Linked Lists.C/C++ Program for Write a recursive function to print reverse of a Linked ListC/C++ Program for Remove duplicates from a sorted linked listC/C++ Program for Remove duplicates from an unsorted linked listC/C++ Program for Reverse a Doubly Linked ListC/C++ Program for Split a Circular Linked List into two halvesC/C++ Program for Practice questions for Linked List and RecursionC/C++ Program for Move last element to front of a given Linked ListC/C++ Program for Pairwise swap elements of a given linked listC/C++ Program for Delete a node in a Doubly Linked ListC/C++ Program for Intersection of two Sorted Linked ListsC/C++ Program for Delete alternate nodes of a Linked ListC/C++ Program for Alternating split of a given Singly Linked ListC/C++ Program for Merge two sorted linked listsC/C++ Program for Identical Linked ListsC/C++ Program for Merge Sort for Linked ListsC/C++ Program for Reverse a Linked List in groups of given sizeC/C++ Program for Sorted insert for circular linked listC/C++ Program for Reverse alternate K nodes in a Singly Linked ListC/C++ Program for Delete nodes which have a greater value on right sideC/C++ Program for Segregate even and odd nodes in a Linked ListC/C++ Program for Detect and Remove Loop in a Linked ListC/C++ Program for XOR Linked List – A Memory Efficient Doubly Linked List | Set 1C/C++ Program for Add two numbers represented by linked lists | Set 1C/C++ Program for How to write C functions that modify head pointer of a Linked List?C/C++ Program for Delete a given node in Linked List under given constraintsC/C++ Program for Sorted Linked List to Balanced BSTC/C++ Program for In-place conversion of Sorted DLL to Balanced BSTC/C++ Program for Union and Intersection of two Linked ListsC/C++ Program for XOR Linked List – A Memory Efficient Doubly Linked List | Set 2C/C++ Program for Find a triplet from three linked lists with sum equal to a given numberC/C++ Program for Rotate a Linked ListC/C++ Program for Implement LRU CacheC/C++ Program for Flattening a Linked ListC/C++ Program for Add two numbers represented by linked lists | Set 2C/C++ Program for Sort a linked list of 0s, 1s and 2sC/C++ Program for Flatten a multilevel linked listC/C++ Program for QuickSort on Doubly Linked ListC/C++ Program for Swap Kth node from beginning with Kth node from end in a Linked ListC/C++ Program for Design a stack with operations on middle elementC/C++ Program for Delete N nodes after M nodes of a linked listC/C++ Program for QuickSort on Singly Linked ListC/C++ Program for Merge a linked list into another linked list at alternate positionsC/C++ Program for Pairwise swap elements of a given linked list by changing linksC/C++ Program for Given a linked list, reverse alternate nodes and append at the endC Program for Bubble Sort on Linked ListStack C/C++ Programs:C/C++ Program for Infix to Postfix Conversion using StackC/C++ Program for Evaluation of Postfix ExpressionC/C++ Program for Reverse a Sting using StackC/C++ Program for Implement two stacks in an arrayC/C++ Program for Check for balanced parentheses in an expressionC/C++ Program for Next Greater ElementC/C++ Program for Reverse a stack using recursionC/C++ Program for The Stock Span ProblemC/C++ Program for Design and Implement Special Stack Data StructureC/C++ Program for Implement Stack using QueuesC/C++ Program for Design a stack with operations on middle elementQueue C/C++ Programs:C/C++ Program for Queue Introduction and Array ImplementationC/C++ Program for Linked List Implementation of QueueC/C++ Program for Implement Queue using StacksC/C++ Program for Check whether a given Binary Tree is Complete or notC/C++ Program for Find the largest multiple of 3Tree C/C++ Programs:C/C++ Program for Tree TraversalsC/C++ Program for Write a C program to Calculate Size of a treeC/C++ Program for Write C Code to Determine if Two Trees are IdenticalC/C++ Program for Write a C Program to Find the Maximum Depth or Height of a TreeC/C++ Program for Write a C program to Delete a Tree.C/C++ Program for Write an Efficient C Function to Convert a Binary Tree into its Mirror TreeC/C++ Program for If you are given two traversal sequences, can you construct the binary tree?C/C++ Program for Given a binary tree, print out all of its root-to-leaf paths one per line.C/C++ Program for Lowest Common Ancestor in a Binary Search Tree.C/C++ Program for The Great Tree-List Recursion Problem.C/C++ Program for Find the node with minimum value in a Binary Search TreeC/C++ Program for Level Order Tree TraversalC/C++ Program for Program to count leaf nodes in a binary treeC/C++ Program for A program to check if a binary tree is BST or notC/C++ Program for Level order traversal in spiral formC/C++ Program for Check for Children Sum Property in a Binary Tree.C/C++ Program for Convert an arbitrary Binary Tree to a tree that holds Children Sum PropertyC/C++ Program for Diameter of a Binary TreeC/C++ Program for How to determine if a binary tree is height-balanced?C/C++ Program for Inorder Tree Traversal without RecursionC/C++ Program for Inorder Tree Traversal without recursion and without stack!C/C++ Program for Root to leaf path sum equal to a given numberC/C++ Program for Construct Tree from given Inorder and Preorder traversalsC/C++ Program for Given a binary tree, print all root-to-leaf pathsC/C++ Program for Double TreeC/C++ Program for Maximum width of a binary treeC/C++ Program for Total number of possible Binary Search Trees with n keysC/C++ Program for Foldable Binary TreesC/C++ Program for Print nodes at k distance from rootC++ Program for Inorder predecessor and successor of a given key in BSTC/C++ Program for Sorted order printing of a given array that represents a BSTC/C++ Program for Applications of tree data structureC/C++ Program for Inorder Successor in Binary Search TreeC/C++ Program for Find k-th smallest element in BST (Order Statistics in BST)C/C++ Program for Get Level of a node in a Binary TreeC/C++ Program for Print Ancestors of a given node in Binary TreeC/C++ Program for Print BST keys in the given rangeC/C++ Program for Tournament Tree (Winner Tree) and Binary HeapC/C++ Program for Check if a given Binary Tree is SumTreeC/C++ Program for Decision Trees – Fake (Counterfeit) Coin Puzzle (12 Coin Puzzle)C/C++ Program for Check if a binary tree is subtree of another binary treeC/C++ Program for Trie | (Insert and Search)C/C++ Program for Trie | (Delete)C/C++ Program for Connect nodes at same levelC/C++ Program for Connect nodes at same level using constant extra spaceC/C++ Program for Sorted Array to Balanced BSTC/C++ Program for Populate Inorder Successor for all nodesC/C++ Program for Convert a given tree to its Sum TreeC/C++ Program for Find the largest BST subtree in a given Binary TreeC/C++ Program for AVL Tree | Set 1 (Insertion)C/C++ Program for Vertical Sum in a given Binary TreeC/C++ Program for AVL Tree | Set 2 (Deletion)C/C++ Program for Merge Two Balanced Binary Search TreesC/C++ Program for Find the maximum sum leaf to root path in a Binary TreeC/C++ Program for Merge two BSTs with limited extra spaceC/C++ Program for Binary Tree to Binary Search Tree ConversionC/C++ Program for Construct Special Binary Tree from given Inorder traversalC/C++ Program for Construct a special tree from given preorder traversalC/C++ Program for Check if each internal node of a BST has exactly one childC/C++ Program for Check whether a given Binary Tree is Complete or notC/C++ Program for Boundary Traversal of binary treeC/C++ Program for Two nodes of a BST are swapped, correct the BSTC/C++ Program for Construct Full Binary Tree from given preorder and postorder traversalsC/C++ Program for Construct BST from given preorder traversal | Set 1C/C++ Program for Construct BST from given preorder traversal | Set 2C/C++ Program for Floor and Ceil from a BSTC/C++ Program for Iterative Preorder TraversalC/C++ Program for Convert a BST to a Binary Tree such that sum of all greater keys is added to every keyC/C++ Program for Morris traversal for PreorderC/C++ Program for Linked complete binary tree & its creationC/C++ Program for Ternary Search TreeC/C++ Program for Segment Tree | Set 1 (Sum of given range)C/C++ Program for Segment Tree | Set 2 (Range Minimum Query)C/C++ Program for Dynamic Programming | Set 26 (Largest Independent Set Problem)C/C++ Program for Iterative Postorder Traversal | Set 1 (Using Two Stacks)C/C++ Program for Iterative Postorder Traversal | Set 2 (Using One Stack)C/C++ Program for Find if there is a triplet in a Balanced BST that adds to zeroC/C++ Program for Find a pair with given sum in a Balanced BSTC/C++ Program for Reverse Level Order TraversalC/C++ Program for Construct Complete Binary Tree from its Linked List RepresentationC/C++ Program for Remove BST keys outside the given rangeC/C++ Program for Convert a given Binary Tree to Doubly Linked List | Set 1C/C++ Program for B-Tree | Set 1 (Introduction)C/C++ Program for B-Tree | Set 2 (Insert)C/C++ Program for Longest prefix matching – A Trie based solution in JavaC/C++ Program for Tree Isomorphism ProblemC/C++ Program for Find all possible interpretations of an array of digitsC/C++ Program for Iterative Method to find Height of Binary TreeC/C++ Program for Custom Tree ProblemC/C++ Program for Check for Identical BSTs without building the treesC/C++ Program for Convert a given Binary Tree to Doubly Linked List | Set 2C/C++ Program for Print ancestors of a given binary tree node without recursionC/C++ Program for Difference between sums of odd level and even level nodes of a Binary TreeC/C++ Program for Print Postorder traversal from given Inorder and Preorder traversalsC/C++ Program for Find depth of the deepest odd level leaf nodeC/C++ Program for Check if all leaves are at same levelC/C++ Program for Print Left View of a Binary TreeC/C++ Program for B-Tree | Set 3 (Delete)C/C++ Program for Add all greater values to every node in a given BSTC/C++ Program for Remove all nodes which don’t lie in any path with sum>= kC/C++ Program for Extract Leaves of a Binary Tree in a Doubly Linked ListC/C++ Program for Deepest left leaf node in a binary treeC/C++ Program for Find next right node of a given keyC/C++ Program for Splay Tree | Set 1 (Search)C/C++ Program for Splay Tree | Set 2 (Insert)C/C++ Program for Sum of all the numbers that are formed from root to leaf pathsC/C++ Program for Red-Black Tree | Set 1 (Introduction)C/C++ Program for Red-Black Tree | Set 2 (Insert)C/C++ Program for Convert a given Binary Tree to Doubly Linked List | Set 3C/C++ Program for Print all nodes that don’t have siblingC/C++ Program for Lowest Common Ancestor in a Binary Tree | Set 1C/C++ Program for Find distance between two given keys of a Binary TreeC/C++ Program for Print all nodes that are at distance k from a leaf nodeC/C++ Program for Check if a given Binary Tree is height balanced like a Red-Black TreeC/C++ Program for Interval TreeC/C++ Program for Print a Binary Tree in Vertical Order | Set 1C/C++ Program for Print all nodes at distance k from a given nodeC/C++ Program to find the maximum path sum between two leaves of a binary treeGraph C/C++ Programs:C/C++ Program for Depth First Traversal for a GraphC/C++ Program for Breadth First Traversal for a GraphC/C++ Program for Detect Cycle in a Directed GraphC/C++ Program for Find if there is a path between two vertices in a directed graphC/C++ Program for Hamiltonian Cycle DetectionC/C++ Program for Dynamic Programming | Set 16 (Floyd Warshall Algorithm)C/C++ Program for Find the number of islandsC/C++ Program for Union-Find Algorithm | Set 1 (Detect Cycle in a an Undirected Graph)C/C++ Program for Union-Find Algorithm | Set 2 (Union By Rank and Path Compression)C/C++ Program for Greedy Algorithms | Set 2 (Kruskal’s Minimum Spanning Tree Algorithm)C/C++ Program for Graph and its representationsC/C++ Program for Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST))C/C++ Program for Greedy Algorithms | Set 6 (Prim’s MST for Adjacency List Representation)C/C++ Program for Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm)C/C++ Program for Greedy Algorithms | Set 8 (Dijkstra’s Algorithm for Adjacency List Representation)C/C++ Program for Dynamic Programming | Set 23 (Bellman–Ford Algorithm)C/C++ Program for Transitive closure of a graphC/C++ Program for Check whether a given graph is Bipartite or notC/C++ Program for Topological SortingC/C++ Program for Shortest Path in Directed Acyclic GraphC/C++ Program for Strongly Connected ComponentsC/C++ Program for Articulation Points (or Cut Vertices) in a GraphC/C++ Program for Bridges in a graphC/C++ Program for Biconnected graphC/C++ Program for Connectivity in a directed graphC/C++ Program for Eulerian path and circuitC/C++ Program for Ford-Fulkerson Algorithm for Maximum Flow ProblemC/C++ Program for Maximum Bipartite MatchingC/C++ Program for Find minimum s-t cut in a flow networkC/C++ Program for Fleury’s Algorithm for printing Eulerian Path or CircuitC/C++ Program for Longest Path in a Directed Acyclic GraphC/C++ Program for Find maximum number of edge disjoint paths between two verticesC/C++ Program for Detect cycle in an undirected graphC/C++ Program for Travelling Salesman Problem | Set 1 (Naive and Dynamic Programming)C/C++ Program for Travelling Salesman Problem | Set 2 (Approximate using MST)C/C++ Program for Johnson’s algorithm for All-pairs shortest pathsC/C++ Program for Graph Coloring | Set 1 (Introduction and Applications)C/C++ Program for Graph Coloring | Set 2 (Greedy Algorithm)C/C++ Program for Some interesting shortest path questions | Set 1C/C+ program to Reverse alternate levels of a perfect binary treeC/C++ program to transform a BST to greater sum treeBit-Magic C/C++ Program:C/C++ Program for Next Power of 2C/C++ Program for Write an Efficient Method to Check if a Number is Multiple of 3C/C++ Program for Write a C program to find the parity of an unsigned integerC/C++ Program for Efficient way to multiply with 7C/C++ Program for Write one line C function to find whether a no is power of twoC/C++ Program for Position of rightmost set bitC/C++ Program for Find the Number Occurring Odd Number of TimesC/C++ Program for Check for Integer OverflowC/C++ Program for Little and Big Endian MysteryC/C++ Program for Write an Efficient C Program to Reverse Bits of a NumberC/C++ Program for Count set bits in an integerC/C++ Program for Count number of bits to be flipped to convert A to BC/C++ Program for Find the two non-repeating elements in an array of repeating elementsC/C++ Program for Rotate bits of a numberC/C++ Program for Compute the minimum or maximum of two integers without branchingC/C++ Program for Compute modulus division by a power-of-2-numberC/C++ Program for Compute the integer absolute value (abs) without branchingC/C++ Program for Find whether a given number is a power of 4 or notC/C++ Program for Turn off the rightmost set bitC/C++ Program for Multiply a given Integer with 3.5C/C++ Program for Add 1 to a given numberC/C++ Program for Optimization Techniques | Set 1 (Modulus)C/C++ Program for Next higher number with same number of set bitsC/C++ Program for Program to count number of set bits in an (big) arrayC/C++ Program for A Boolean Array PuzzleC/C++ Program for Smallest of three integers without comparison operatorsC/C++ Program for Add two numbers without using arithmetic operatorsC/C++ Program for Swap bits in a given numberC/C++ Program for Count total set bits in all numbers from 1 to nC/C++ Program for Detect if two integers have opposite signsC/C++ Program for Find the element that appears onceC/C++ Program for Binary representation of a given numberC/C++ Program for Write your own strcmp that ignores casesC/C++ Program for Add two bit stringsC/C++ Program for Swap all odd and even bitsC/C++ Program for Find position of the only set bitC/C++ Program for Divide and Conquer | Set 4 (Karatsuba algorithm for fast multiplication)C/C++ Program for How to swap two numbers without using a temporary variable?C/C++ Program for Check if a number is multiple of 9 using bitwise operatorsC/C++ Mathematical ProgramsC/C++ Program for Write an Efficient Method to Check if a Number is Multiple of 3C Program to print first n Fibonacci NumbersC program to find area of a triangleC Program to find sum of series 1 + 1/2 + 1/3 + 1/4 + .. + 1/nC/C++ Program for Efficient way to multiply with 7C/C++ Program for Write a C program to print all permutations of a given stringC/C++ Program for Lucky NumbersC/C++ Program for Write a program to add two numbers in base 14C/C++ Program for Babylonian method for square rootC/C++ Program for Multiply two integers without using multiplication, division and bitwise operators, and no loopsC/C++ Program for Print all combinations of points that can compose a given numberC/C++ Program for Write you own Power without using multiplication(*) and division(/) operatorsC/C++ Program for Fibonacci numbersC/C++ Program for Average of a stream of numbersC/C++ Program for Check whether a given point lies inside a triangle or notC/C++ Program for Count numbers that don’t contain 3C/C++ Program for Magic SquareC/C++ Program for Sieve of EratosthenesC/C++ Program for Find day of the week for a given dateC/C++ Program for DFA based divisionC/C++ Program for Generate integer from 1 to 7 with equal probabilityC/C++ Program for Given a number, find the next smallest palindromeC/C++ Program for Make a fair coin from a biased coinC/C++ Program for Check divisibility by 7C/C++ Program for Find the largest multiple of 3C/C++ Program for Lexicographic rank of a stringC/C++ Program for Print all permutations in sorted (lexicographic) orderC/C++ Program for Shuffle a given arrayC/C++ Program for Space and time efficient Binomial CoefficientC/C++ Program for Reservoir SamplingC/C++ Program for Pascal’s TriangleC/C++ Program for Select a random number from stream, with O(1) spaceC/C++ Program for Find the largest multiple of 2, 3 and 5C/C++ Program for Efficient program to calculate e^xC/C++ Program for Measure one litre using two vessels and infinite water supplyC/C++ Program for Efficient program to print all prime factors of a given numberC/C++ Program for Print all possible combinations of r elements in a given array of size nC/C++ Program for Random number generator in arbitrary probability distribution fashionC/C++ Program for How to check if two given line segments intersect?C/C++ Program for How to check if a given point lies inside or outside a polygon?C/C++ Program for Convex Hull | Set 1 (Jarvis’s Algorithm or Wrapping)C/C++ Program for Convex Hull | Set 2 (Graham Scan)C/C++ Program for How to check if a given number is Fibonacci number?C/C++ Program for Russian Peasant MultiplicationC Program to Draw a circle without floating point arithmeticC++ Program to print all palindromes in a given rangeC/C++ Dynamic Programming ProgramsC/C++ Program for Largest Sum Contiguous SubarrayC/C++ Program for Ugly NumbersC/C++ Program for Maximum size square sub-matrix with all 1sC/C++ Program for Program for Fibonacci numbersC/C++ Program for Overlapping Subproblems PropertyC/C++ Program for Optimal Substructure PropertyC/C++ Program for Longest Increasing SubsequenceC/C++ Program for Longest Common Subsequence)C/C++ Program for Edit DistanceC/C++ Program for Min Cost PathC/C++ Program for Length of the longest substring without repeating charactersC/C++ Program for Minimum number of jumps to reach endC/C++ Program for Coin Change)C/C++ Program for Matrix Chain MultiplicationC/C++ Program for Binomial CoefficientC/C++ Program for 0-1 Knapsack ProblemC/C++ Program for Egg Dropping PuzzleC/C++ Program for Longest Palindromic SubsequenceC/C++ Program for Cutting a RodC/C++ Program for Maximum Sum Increasing SubsequenceC/C++ Program for Longest Bitonic SubsequenceC/C++ Program for Floyd Warshall AlgorithmC/C++ Program for Palindrome PartitioningC/C++ Program for Partition problemC/C++ Program for Word Wrap ProblemC/C++ Program for Maximum Length Chain of PairsC/C++ Program for Box Stacking ProblemC/C++ Program for Longest Palindromic SubstringC/C++ Program for Bellman–Ford AlgorithmC/C++ Program for Optimal Binary Search TreeC/C++ Program for Subset Sum ProblemC/C++ Program for Largest Independent Set ProblemC/C++ Program for Maximum sum rectangle in a 2D matrixC/C++ Program for Minimum insertions to form a palindromeC/C++ Program for Longest Common SubstringC/C++ Program for Dice ThrowC/C++ Program for Optimal Strategy for a GameC/C++ Program for Word Break ProblemC/C++ Program for Find if a string is interleaved of two other stringsC/C++ Program for Assembly Line SchedulingC/C++ Program for Longest Arithmetic ProgressionC/C++ Program for Maximum Product CuttingC/C++ Program for Count all possible paths from top left to bottom right of a mXn matrixC/C++ Greedy Algorithm ProgramsC/C++ Program Activity Selection ProblemC/C++ Program Kruskal’s Minimum Spanning Tree AlgorithmC/C++ Program for Huffman CodingC/C++ Program for Efficient Huffman Coding for Sorted InputC/C++ Program for Prim’s Minimum Spanning Tree (MST)C/C++ Program for Prim’s MST for Adjacency List RepresentationC/C++ Program for Dijkstra’s shortest path algorithmC/C++ Program for Dijkstra’s Algorithm for Adjacency List RepresentationC/C++ Program for Graph ColoringC/C++ Program for Rearrange a string so that all same characters become d distance awayC/C++ Backtracking ProgramsC/C++ Program to print all permutations of a given stringC/C++ Program The Knight’s tour problemC/C++ Program for Rat in a MazeC/C++ Program for N Queen ProblemC/C++ Program for Subset SumC/C++ Program for m Coloring ProblemC/C++ Program for Hamiltonian CycleC/C++ Program for SudokuC/C++ Program for Tug of WarC/C++ Program for (Solving Cryptarithmetic PuzzlesC/C++ Divide and Conquer Programs:C/C++ Program for Write a C program to calculate pow(x,n)C/C++ Program for Median of two sorted arraysC/C++ Program for Count Inversions in an arrayC/C++ Program for Check for Majority Element in a sorted arrayC/C++ Program for Maximum and minimum of an array using minimum number of comparisonsC/C++ Program for Program to count number of set bits in an (big) arrayC/C++ Program for Count the number of occurrences in a sorted arrayC/C++ Program for Find a Fixed Point in a given arrayC/C++ Program for Find the maximum element in an array which is first increasing and then decreasingC/C++ Program for Median of two sorted arrays of different sizesC/C++ Program for Closest Pair of PointsC/C++ Program for Maximum Subarray SumC/C++ Program for Largest Rectangular Area in a HistogramC/C++ Program for Karatsuba algorithm for fast multiplication)C/C++ Program for Find a peak elementC/C++ Program for Find the point where a monotonically increasing function becomes positive first timeC/C++ Program for Find the minimum element in a sorted and rotated arrayC/C++ Program for Closest Pair of Points | O(nlogn) ImplementationC/C++ String Searching Programs:C/C++ Program for Naive Pattern SearchingC/C++ Program for KMP AlgorithmC/C++ Program for Rabin-Karp AlgorithmC/C++ Program for A Naive Pattern Searching QuestionC/C++ Program for Finite AutomataC/C++ Program for Efficient Construction of Finite AutomataC/C++ Program for Boyer Moore Algorithm – Bad Character HeuristicC/C++ Program for String matching where one string contains wildcard charactersC/C++ Program for Suffix ArrayC/C++ Geometric Algorithm Programs:C/C++ Program for How to check if two given line segments intersect?C/C++ Program for How to check if a given point lies inside or outside a polygon?C/C++ Program for Convex Hull | (Jarvis’s Algorithm or Wrapping)C/C++ Program for Convex Hull | (Graham Scan)C/C++ Program for Given n line segments, find if any two segments intersectC/C++ Program for Closest Pair of Points | O(nlogn) ImplementationC/C++ Program for Find if two rectangles overlapC/C++ Misc Programs:C Program to print environment variableC Program for Tower of HanoiC Program to print Floyd’s triangleC Program to Swap two NumbersC program swap two numbers without using a temporary variableC Program to check if a given year is leap yearC Program to sum the digits of a given number in single statement?C program to print numbers from 1 to 100 without using loop?C Program to print contents of fileC program to copy contents of one file to another fileC Program to list all files and sub-directories in a directoryC program to delete a fileC Program to merge contents of two files into a third fileC Program to count number of lines in a fileC/C++ Program for Check if a number is PalindromeC/C++ Program for Print all possible combinations of r elements in a given array of size nC/C++ Program for Print all possible strings of length k that can be formed from a set of n charactersC/C++ Program to Find Excel column name from a given column numberC/C++ Program to Find next greater number with same set of digitsC/C++ Program to Count Possible Decodings of a given Digit SequenceC/C++ Program to calculate the angle between hour hand and minute hand Create Quiz Comment R rahulsharmagfg1 Follow 4 Improve R rahulsharmagfg1 Follow 4 Improve Article Tags : C++ Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++3 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++12 min readFile Handling in C++8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++3 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL2 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Like