Data structures and Algorithms (2)-----> strings

Source: Internet
Author: User

1. Some features of the string 1.1 extensive

(1) A string can be treated as an array of character types-----> so may involve sorting + lookups;

(2) Many problems can be converted to the method of string type to solve;

   It is important to note that in the Java language implementation of string type problems, you need to master StringBuffer, StringBuilder class and ToCharArray methods to solve the problem.

1.2 Concepts that need to be mastered

(1) Palindrome: is a literal reading and anti-reading are the same string;

(2) String: A subsequence of any successive character in a string is called a substring of the string;

(3) Sub-sequence: discontinuous;

(4) prefix tree (trie tree):

(5) suffix tree and suffix array:

(6) Matching

(7) Dictionary order

1.3 Operations to be mastered

(1) Array-related operations: additions and deletions to investigate;

(2) Substitution of characters

(3) Rotation of the string

2. Common types of String titles 2.1 rule judgments

(1) Determining whether a string conforms to an integer rule;

(2) Determining whether a string conforms to floating-point rules;

(3) Determine whether the string conforms to the palindrome string rules;

...... Et cetera (Yes--->true; not---->faulse)

2.2 Numeric operations

(1) Int and long expressions have a finite range of integers, so large integers are often implemented with strings;

(2) The subtraction operation which is related to the large integer needs to simulate the written calculation process;

2.3 Types related to array operations

(1) array-related adjustment, sequencing and other operations need to master;

(2) The division process of fast sorting needs to be mastered and rewritten;

2.4 Character Count

(1) Hash table

(2) fixed-length array: C + + (256 length) Java (65536 length)

(3) The problem of sliding window, searching for the problem of non-repetition character string, calculating the problem of displacement words;

2.5 Dynamic planning Types

(1) the longest common substring;

(2) the longest common subsequence;

(3) longest back text string;

(4) the longest palindrome subsequence;

...... Wait a minute

2.6 Search Types

(1) Width first search;

(2) Depth first search;

2.7 Advanced algorithms and data structures to solve problems (more difficult, general interview not how to appear)

(1) The Manacher algorithm solves the problem of the longest palindrome substring;

(2) KMP algorithm solves the problem of string matching;

(3) Prefix tree structure

(4) suffix tree and suffix array;

Data structures and Algorithms (2)-----> strings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.