Strings MCQs
Solve topic-wise placement questions and improve your skills.
KMP runs in O(N + M) time by precomputing the longest proper prefix which is also suffix (LPS array).
Trie allows prefix searches in O(L) time where L is the length of the query string.
String immutability provides security for database connections/URLs, allows string interning in string constant pool, and ensures safe multithreading.
Rabin-Karp uses a rolling hash to compare pattern hash with substring hashes in O(1) average time.
A fixed-size array of 26 integers tracks character counts in O(N) time and O(1) space.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.
Using sliding window and two pointers solves this problem in O(N) linear time.