Questions tagged [strings]
Questions about sequences of symbols, sets thereof and their properties as well as uses.
509
questions
1
vote
0
answers
28
views
Sliding-window string/substring algorithm based on endpoints of substring
While there are various known algorithms to check if a string contains a substring (with the simplest but least efficient one being a brute-force sliding window, and one of the most efficient but ...
1
vote
0
answers
32
views
Sparse bit string pattern matching
Suppose there are two strings of bits. Let's call them the needle (n) and the haystack (h).
We'll say that the needle matches ...
0
votes
0
answers
65
views
Multitape Turing Machine to accept power of 2 length 0's string?
I have been trying to find a multitape Turing Machine in order to accept a input string which consists on 0's and whose length is a power of 2:
However, Im getting troubble finding it, because I dont ...
0
votes
0
answers
28
views
How to compute an inverse suffix array $ISA$ from a suffix array $SA$ efficiently?
I cannot help but wonder: how to compute an inverse of a suffix array, preferably in linear time?
For $ISA$, it holds that $ISA[SA[i]] = i$.
0
votes
0
answers
19
views
What sub-sequences do strings for the standard scientific units have in common?
As motivation, a Space Craft known as the Mars Climate Orbiter failed in the year 1999.
The failure occurred because the distinction between pound-force seconds and newton-seconds was made as an ...
0
votes
0
answers
37
views
Proof Closer String/Consensus String/Center String is NP-hard
Given are n gene sequences (words over the alphabet {A, T, C, G}), each of length m. Find a gene sequence (of length m) that minimizes the maximum distance to all given gene sequences. Here, distance ...
0
votes
0
answers
28
views
Use case for string matching in a 2 by n grid
In a 2 by n grid there is a character in each cell. A path can start at any cell and then you can move to right or down. This way each path will denote a string written by characters on cells visited ...
2
votes
1
answer
96
views
Repeated Substring Pattern
I've been working on the following challenge on LeetCode:
Problem:
Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together....
0
votes
0
answers
13
views
Flowgarithm for common child program for a beginner (without pointers)
I'm a first year BCA student. Can you help me with flowgarithm of the common child problem (LCS) without pointers
0
votes
1
answer
98
views
Find a substring length $k$ with maximum occurrences
Given a string length $S$, find a substring length $k$ that has the most occurrences in the given string.
We want $O(S)$ time complexity in an average case.
I think the solution lies in sophisticated ...
3
votes
1
answer
108
views
Longest Fibonacci word
We define Fibonacci words as: $F_0 = a, F_1 = b, F_{n+2} = F_n F_{n+1}$, $a, b$ can be any symbols.
How can we find the longest Fibonacci sub-word in a given string in linear time?
This question is ...
1
vote
1
answer
103
views
Problem identification: splitting string into tokens taken from a given, possible overlapping set
I am facing the following problem in a script I am trying to develop:
Given a string and a set of tokens, where the tokens are known and are overlapping (the set can contain the tokens 'a', 'b' and '...
1
vote
0
answers
44
views
Simultaneous matching of all Caesar rotations of a pattern in a text
Suppose we have an alphabet of size $S$, a pattern of length $P$ and a text of length $T$. We want to design an algorithm for matching all caesar rotations of the pattern $P$ in the text $T$. The ...
0
votes
0
answers
23
views
KMP search: Can a shift by partial match prefix by non-suffix match lead to exact match?
Consider the following step where 'abaab', upon failed mismatch, 'ab' the prefix is followed by aligning at 'ab' the suffix. What confuses me is the reason for being able to discard the possibility of ...
0
votes
0
answers
54
views
finding the length of the GCD of two strings
Let's say you have two strings: a and b with GCD c. Why is it that ...