Data Structures and Algorithms (measured circumferential 8- review)

True or False

1. Assuming the pattern string is abababaab, the pattern matching algorithm KMP next [j] = 0 1 1 2 3 4 5 6 2.

     T      F

2. a binary tree traversal sequence after sequence and the sequence is just the same, then any node of the binary tree must have no left child.

     T      F

3. No, corresponding to its two adjacent arc-node table storage structure to an edge in FIG.

     T      F

4. In the tree with n nodes, the number of edges can only be the n-1.

     T      F

5.Prim algorithm is to maintain a forest, every step of the two trees merged into one.

     T      F

6. merge sort algorithm is stable sorting method.

     T      F

7. (neuDS) represented by an ordered sequence of tables and tables can be used single chain binary search method to increase the search speed.

     T      F

Multiple Choice

1. the N records merge sort, merge magnitude is the number of times:

     AO (logN)
     B.O(N)
     CO (NlogN)
     D.O(N 2)

2. the N merge sort records, a degree of spatial complexity:

     AO (logN)
     B.O(N)
     CO (NlogN)
     D.O(N 2 )

3. given key string {4321, 56, 57, 46, 28, 7, 331, 33, 234, 63}, which are selected following the priority bit per-view (LSD) were trip chain radix sort and distribution collection of results?

     A.→331→4321→33→63→234→56→46→57→7→28
     B.→4321→331→33→63→234→56→46→57→7→28
     C.→56→28→4321→331→33→234→46→57→63→7
     D.→57→46→28→7→33→234→63→56→4321→331

4. The shortest path generation algorithm can be used ().

     A.Kruskal algorithm
     B.Dijkstra algorithm
     C.prim algorithm
     D. Huffman algorithm

5. Use Dijkstra (the Dijkstra) algorithm for finding the shortest path for each destination vertex FIG. 1 from the apex to each of the shortest path other vertices are obtained successively:

     A.6, 7, 5, 3, 2, 4
     B.6, 2, 5, 7, 3, 4
     C.2, 3, 4, 5, 6, 7
     D.2, 4, 3, 6, 5, 7

6. Given a directed graph G = (V, E), where {Vl = V, V2, V3, V4, V5, V6, V7}, E = { <V1,V2>, <V1,V3>, <V1,V4>, <V2,V5>, <V3,V5>, <V3,V6>, <V4,V6>, <V5,V7>, <V6,V7>}, the sequence topology G is ().

     A.V1, V2, V5, V3, V4, V6, V7
     B.V1, V3, V4, V6, V2, V5, V7
     C.V1, V3, V2, V6, V4, V5, V7
     D.V1, V3, V4, V5, V2, V6, V7

FIG 7 is provided with a logical structure of data B = (K, R), wherein the vertex set {K = K . 1 , K 2 , ⋯, K . 9 }, a directed edge set R {= <K . 1 , K . 3 >, <K . 1 , K . 8 >, <K 2 , K . 3 >, <K 2 , K . 4 >, <K 2 , K . 5 >, <K . 3 , K . 9 >, <K . 5 , K . 6 >, <K . 8 , K . 9 >, < K . 9 , K . 7 >, <K . 4 , K . 7 >, <K . 4 ,to 6>}. Which of the following is not a corresponding sequence of DAG topology map?


     If 1 , k 2 , k 3 , k 4 , k 5 , k 6 , k 8 to 9 to 7

     Bk 2 , a 5 , a 1 , a 4 , a 6 , a 8 , a 3 , a 9 to 7

     Ck 2 , k 4 , k 5 , k 6 , k 7 , k 1 , k 3 , k 8 to 9

     Dk 1 to 8 , k 2 , k 3 , k 9 , k 4 , k 7 , k 5 to 6


8. AOE- network as shown , the first event occurrence time ⑤ Is

     A.21
     B.26
     C.38
     D.43

9. When KMP algorithm for pattern matching, pattern string "ababaaababaa" is the next array ____.

     A.-1,0,1,2,3,4,5,6,7,8,9,9
     B.-1,0,1,2,1,2,1,1,1,1,2,1
     C.-1,0,0,1,2,3,1,1,2,3,4,5
     D.-1,0,1,2,3,0,1,2,3,2,2,3

10.如模式串t = "abcabaa",采用KMP算法或改进的KMP算法进行模式匹配时,next函数值和nextval函数值(下标从0开始)分别为:@@

     A.next={-1,0,0,0,1,2,1}, nextval={-1,-1,-1,-1,1,2,-1}
     B.next={-1,0,0,1,0,2,1}, nextval={-1,0,0,0,1,2,1}
     C.next={-1,0,0,0,1,2,1}, nextval={-1,0,0,-1,1,2,1}
     D.next={-1,0,0,0,1,2,1} , nextval={-1,0,0,-1,0,2,1}

Guess you like

Origin www.cnblogs.com/nonlinearthink/p/11874401.html