C++ Programming for Aho-Corasick Algorithm for Pattern Searching – Searching and sorting – Aho-Corasick Algorithm finds all words in O(n + m + z) time.
C++ programming
C++ Programming for Write a program to print all permutations of a given string – Mathematical Algorithms -A permutation also called an “arrangement number”
C++ Programming-Backtracking Set 2 (Rat in a Maze) – Backtracking – A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1].
C++ Programming for Anagram Substring Search Or Search for all permutations – Searching and sorting – A simple idea is to modify Rabin Karp Algorithm.
C++ Programming-Write a program to print all permutations of a given string – Searching and Sorting – A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself.
C++ Programming-Print all possible strings that can be made by placing spaces – Searching and Sorting -The idea is to use recursion and create a buffer.
C++ Programming-Searching for Patterns Set 1 Naive Pattern Searching – Searching and Sorting – Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[].
C++ Program Count 1’s in a sorted binary array – Searching and Sorting – A simple solution is to linearly traverse the array. The time complexity of the simple solution is O(n). We can use Binary Search to find count in O(Logn) time.
C++ programming – Given a sorted array and a number x, find the pair in array whose sum is closest to x – Searching and sorting – Given a sorted array and a number x, find a pair in array whose sum is closest to x.
C++ Programming – Longest Common Subsequence – Dynamic Programming – LCS problem has optimal substructure property as main problem can be solved.