数据结构第五章串和数组演习(国外英文资料).docVIP

  • 5
  • 0
  • 约4.38万字
  • 约 11页
  • 2017-06-08 发布于河南
  • 举报

数据结构第五章串和数组演习(国外英文资料).doc

数据结构第五章串和数组演习(国外英文资料)

数据结构第五章串和数组练习(国外英文资料) Basic concepts: S1 = Data Structure Course, S2 = Structure, S3 = Base. (1) Length (S1); 21 (2) (2) Compare (S2, S3); 1 (3) Insert (S1, 5, S3); The DataBase Structure Course (4) Delete (S1, 5, 9); Datae Course (5) SubString (S1, 5, 9, T); Structur (6) Search (S1, 0, S2); (7) Replace (S1, 0, S2, S3) Data Base Course Algorithm design: Set a string using static array storage structure, and write functions that implement two strings of Compare Compare (S, T). And the comparison is equal to and not equal to two. Void compare (String s1, String s2) { Int I = 0; The else While (I = s1.). I++; } If (I + 1 = = ss.length) Cout = equals \ n ; The else Cout not equal \ n; } Set the string to the static array store structure, and write the function to implement two strings of comparison Compare (S, T). The result is greater than or equal to less than three. Void compare2 (String s1, String s2) { Int Max, flag; Max = s1. Length = s2. Length? S1. For (int I = 0; I Max; I + +) { If (sb.elem [I] s2. Elem [I]) {... Flag = 1; Break; } The else If (s1. Elem [I] s2. Elem [I]) Flag = 1; Break; } The else The continue; } If (flag = = 1) Cout s1 s2 \ n; If (flag = = 1) The cout s2 \ n ; If (I = = s1. Length) Cout s1 = s2 \ n; } Four sets of dynamic array storage structures, and write functions that implement two strings of comparison Compare (S, T). The result is greater than or equal to less than three. Comparing this problem with the algorithm of problem 4-13, whether the static array storage structure of a string and the dynamic array storage structure of a string is affected by the comparison algorithm of the writing string. Static array storage structure, which defines the length of the string and the length of the character. Dynamic array storage structure, which can be used to determine the length of characters as needed. 5 a string of the static array storage structure, write a function realizes the string to Replace the Replace (S, start, T

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档