Data Structures and Algorithms -Chapter4- string - Exercises

Multiple Choice

1. empty string and the string is the same space, this statement
A. Correct B. Incorrect

2 is a special string linear table, which is reflected in particularity
A. B. may sequentially store the data elements are stored in a character can be linked D. C. may be a plurality of character data elements

3 is provided with two strings p and q, q computation request first appears in the p-position is referred to as
A connector B C Qiuzi string pattern matching string length requirements D

4. disposed string s1 = 'ABCDEFG', s2 = 'PQRST', function con (x, y) returns the connection string x and y strings, subs (s, i, j ) returns a character string starting from the number s i, j characters of string, the length len (s) returns a string s, then con (subs (s1,2, len ( s2)), subs (s1, len (s2), 2)) is the result of a string
A) BCDEF B) BCDEFG C) BCPQRST D) BCDEFEF

Fill in the blank

1. The string is two basic storage (sequential storage) and (chain stores)

Necessary and sufficient condition is equal to 2. The two strings (strings of equal length and the same position of each character)

3 is an empty string (character string of zero), a length equal to (0).

4. The string is a space (or a string composed of a plurality of spaces), a length equal to (the number of space characters).

The set s = 'I_AM_A_TEACHER', its length (14)

Application title

1. The two strings are known as s1 = "bc cad cabcadf", s2 = "abc", the length Find the two strings, and determines whether the string is a substring of s1 s2 string; If s2 s1 sub-string, Please indicate the starting position of s1 s2.
9

2. For each string design represents a two storage algorithm determines whether the string is palindromic (i.e., right reading and verlan same as "abcba" is a palindrome, and "abc" are not) (write only the algorithm thought).

发布了391 篇原创文章 · 获赞 650 · 访问量 4万+

Guess you like

Origin blog.csdn.net/weixin_43896318/article/details/104092713