×
Home Discussions Write at Opengenus IQ
×
  • Track your progress
  • RANDOM
  • Join our Internship 🎓
  • 100+ Graph Algorithms
  • 100+ DP Problems
  • 50+ Linked List Problems
  • 50+ Array Problems
  • One Liner
  • 50+ Binary Tree problems
  • #7daysOfCode
  • Linux 💽
  • 🔊 Data Structures
  • Graph Algorithms
  • Dynamic Programming 💑
  • Home

String Algorithms

String Algorithms are algorithms to perform specify tasks on strings such as string pattern matching, searching string data and much more.

Algorithms

Longest word with given prefix and suffix

You are given a list of words, a prefix, and a suffix. You have to find the longest word in the given word list that has a given prefix and suffix.

Gaurav Kumar
String Algorithms

Lexicographic rank of string

We will see what is the rank of the string in lexicographic order, for the words which can be made using all the characters of the given string and calculate using a string algorithm.

Rahul Kumar Yadav
trie

Longest word in dictionary with all prefixes

Given a list of words ‘WORDLIST’, find the longest perfect word. A perfect word is a word in which all the possible prefixes are present in ‘WORDLIST’.

Gaurav Kumar
String Algorithms

Find permutations of string in lexicographic order

In this article, we have presented an algorithm to Find permutations of string in lexicographic order. We have used the concept of Recursion.

Rahul Kumar Yadav
Algorithms

Number of Substrings in String of 0s and 1s that have K 1s

In this article, we have explored algorithm to find the Number of Substrings in a String of 0's and 1's that have 'K' number of 1's.

Deepak Tiwari
String Algorithms

Find all anagrams of a given string

In this article, we have explained efficient algorithms to Find all anagrams of a given string. This involve techniques like sliding window approach.

Kartheesh Reddy Koripelli
Data Structures

Persistent Trie

In this article, we discuss the Trie data structure and how to make it persistent to solve various problems optimally.

Erick Lumunge
Algorithms

Longest Substring with at Least K repeating characters

In this article, we have presented two algorithms to find the Longest Substring with at Least K repeating characters.

Raghu Ramjee Raghu Ramjee
Algorithms

Maximum String Partition problem: Partition Labels

In this article, we have explored approaches to solve the maximum string partition problem (Partition Labels) efficiently.

Kartik Keyan Kant Kartik Keyan Kant
Algorithms

Substring with Concatenation of All Words

In this article, we have explained two approaches to solve the problem Substring with Concatenation of All Words. This involves the idea of Hash Map and Two Pointer.

Joe Gorst Joe Gorst
Algorithms

ZigZag Conversion of String with N rows

In this article, we have solved the problem of ZigZag Conversion of String with N rows. We take a string and a number N (rows) as input and distribute the string in ZigZag fashion among N rows and print the final string.

Joe Gorst Joe Gorst
Algorithms

Longest Common Prefix

In this article, we are going to explore different approaches to find the longest common prefix between two strings. Same techniques can be applied to find the Longest Common Prefix for multiple strings.

Thompson Mina
Algorithms

Longest substring without repeating characters

In this article, we have explained three approaches to the problem of finding Longest substring without repeating characters. This involves the use of Hash Map with the clever use of start and end index.

Akanksha Singh
Algorithms

Longest Common Suffix Problem

In this article, we will see how we can find the longest common suffix (i.e ending) that all the strings given to us have. We shall start with the brute-force approach for two strings. Following this, we will implement the Trie data structure to solve the problem for more than two strings.

J. Varun Iyer J. Varun Iyer
Algorithms

Deleting Duplicate Characters of String

We have explored the problem of Deleting Duplicate Characters of String such that the resulting string is lexicographically the smallest among all possibilities.

Nolan Biscaro
Algorithms

Number of sub-strings with each character occurring even times

This article discusses different algorithmic approach which we can use to find number of sub-strings with each character in it occurring even number times for a given string.

Vishwajith K
Algorithms

Number of distinct substrings of length K

We have explained the approach to find the Number of distinct substrings of length K using Rolling hash technique, hash table and brute force approach.

Sushma Narayan Hegde
Algorithms

Generate all sub-strings of a string

We have explored the approach of generating / printing all sub-strings of a given String and have provided the implementation to do so. The time complexity to generate all substring is O(N^3) time and there are O(N^2) sub-strings for a string of length N.

Vishwajith K
Algorithms

Number of Substrings with distinct characters

We have explored various algorithms that will help us in determining the number of substrings that a string can have with distinct characters.

Vansh Pratap Singh Vansh Pratap Singh
String Algorithms

Number of palindromic substrings in a string

A string is a palindrome when it reads the same backward as forward and a substring is a contiguous sequence of characters within the string. We have discussed multiple approaches to find the number of palindromic substrings in a given string.

Shreya Shah Shreya Shah
Algorithms

Check if a string is a subsequence of another string

In this problem, we will see how we can check whether a string is a subsequence of another string. We have solved this in O(N) time using an efficient approach.

Vasu Soni Vasu Soni
Algorithms

Number of substrings with exactly k distinct characters

In this problem, we are given a string and our job is to count the total number of substrings of the given string that contains exactly k distinct characters. We have explored 3 approaches to solve this.

Raghavendra Achar C
Algorithms

Shift OR algorithm for String Matching

Shift OR algorithm uses bitwise techniques to check whether the given pattern is present in the string or not. It is efficient if the pattern length is lesser than the memory-word size of the machine

Raghavendra Achar C
Algorithms

Convert one string to another by changing all occurrence of a character to another

We will be solving Check if one string can be converted to another by changing all occurrence of a character to another character problem using the Union and Find algorithm.

Raghavendra Achar C
String Algorithms

Minimum number of operations to convert binary string to self-destructing

We will explore algorithms to find the Minimum number of operations to convert a binary string to a self-destructing string.

Aditya Kumar Saroj
OpenGenus IQ © 2022 All rights reserved â„¢ [email: team@opengenus.org]
Top Posts LinkedIn Twitter