Datastructure(SSD5) Review(answer)数据结构.ppt

Data structure(SSD5) Review Chapter1 Introduction Concepts about data structure Review of C++ Algorithm Performance and analysis of algorithm 1.( )For the following program fragment the running time(Big-Oh) is . i = 0; s = 0; while(s ( 5*n*n + 2)) { i++; s = s + i;} a. O(n) b. O(n2) c. O(n1/2) d. O(n3) 2. For the following program fragment the running time(Big-Oh) is . for ( int i = 0; i n; i++ ) for ( int j = 0; j i; j++) s; //s为某种基本操作 O(n) b. O(n2) c. O(n1/2) d. O(n3) 3. Which is non-linear data structure_____. A queue B stack C tree D sequence list Chapter 2 Array ADT of Array Sequential access, address computing of elements in the array Sequence List Operation of sequence list: Access, insert, delete, find, successor and predecessor. Time complexity of these operations. ADT of Polynomial Representation of polynomial and Addition Special Array and Sparse Array: storage and compression STL vector, deque,list and string 1. We store a 4×4 symmetric matrix A into an array B (index start from 0)with row major order Store the lower triangle only, the index of element a[2][3] in B is . 2. ( )The worst-time for removing an element from a sequence list (Big-Oh) is . a. O(1) b. O(n) c. O(n2) d. O(n3) 3. We can use 3 vector type to store value and of non-zero elements in a sparse matrix. Chapter 3 Linked Lists ADT of linked lists Insertion and deletion of single linked list ( header, tail) Static linked list, Circularly Linked Lists, Doubly Linked Lists. Linked list Implementation of Polynomial and Sparse Matrix 1. Which of the following is true ① we can random access an element in array. ② we can random access an element in linked list. ③we cant random access both in array and linked list. ④all above is

文档评论(0)

1亿VIP精品文档

相关文档