Skip to content

Latest commit

 

History

History
44 lines (24 loc) · 2.15 KB

string-problems-en.md

File metadata and controls

44 lines (24 loc) · 2.15 KB

Problems about String

There are many problems about string, including substr implementation, validating palindrome and common substring and so on. Essentially, a string is also an array of characters. So, many ideas of array can be used to solve the problems of string.

There are many algorithms which specifically used for handle strings. Such as trie, huffman tree, Manacher and so on.

Problems about Implementing Build-in Functions of String

This kind of questions are the most direct ones with less ambiguous meanings and less challenging. So, it is always be used in the phone interviews.

Palindrome

A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward. Like "level" and "noon".

There is universal method to check whether a string is palindrome or not which uses two pointers, one at the begining and the other at the end, to move to the middle together step by step. You can check the following question 125for more detials. For finding the longest palindrome, it is possible to reduce many meaningless algorithms if we take full advantage of the feature of palindrome. Manacher's algorithm is a typical example.

Related Questions

Prefix Questions

It is intuitive to use prefix tree to handle this kind of questions. But it also has some disadvantages. For example, if there are less common prefix, using prefix tree may cost more RAMs.

Related Questions

-14.longest-common-prefix -208.implement-trie-prefix-tree

Other Questions