Definition and implementation of strings

Source: Internet
Author: User

A string is a finite sequence consisting of zero or multiple characters. It is also called a string. It is generally recorded as S = "a1a2a3 ........ an "(n> = 0), where S is the name of the string, and the character series enclosed in double quotation marks are the value of the string. AI (1 <= I <= N) can be letters, numbers, or other symbols. I is the position of the character in the string. N is the length of a string. The so-called series refers to the relationship between the adjacent characters of a string with a forward and backward relationship.

String size comparison:

S = "a1a2... a" t = "b1b2... bn"

1. When n = m and A1 = b1, a2 = B2,... an = BN, S = T.

2. n <m. and AI = Bi (I = 1, 2 ,........ n ). for example, S = "Hap" t = "happy" s <t.

3. A k <= min (m, n) exists, so that AI = Bi (I = 1, 2 ...... k-1), AK <BK. for example, S = "happen" t = "happy" s <t.

Sequential string Storage Structure

Uses a set of sequential address storage units to store character series in strings. Assign a fixed-length storage area for each predefined string variable according to the predefined size. It is generally defined by a fixed-length array. A string is followed by an ending character that is not included in the length. For example, "\ 0" indicates that the string is worth ending.

Key KMP fuzzy matchAlgorithm.

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.