2017-2018 Data Structure Final Exam Questions Recall Version

I didn't feel very good after the exam, so I wrote a memoir version for the students to refer to~ You can use it as a reference when reviewing at the end of the term~


17-18 Data Structures Reminiscence Edition

 

1. Fill in the blanks (20 points)

1. How many elements need to be moved to delete the i-th element in the linear table (see Chapter 3 of ppt)

2. (Exercise with no related topics before) Complexity analysis 

      (1)s=i=0while(s<=n)i++ s+=i

(2)

(3)while(i<=n)i*=2

3. RF, a total of M elements Find the position

4.??

5. (There is a similarity in the classification of the hash) Hash%17 (1) Find the sequence

        (2) Find? ? and 85 times

 

2. Application questions (35 points)

1. Can the in-order and post-order determine a binary tree? If the determination process can be written, and the result of the pre-order traversal can be written.

2. A complete binary tree level traversal sequence, (1) build a heap, find the time complexity (2) heap sort delete the largest to get the first sorting result

3. The establishment of Huffman tree seek Huffman coding and weights

4. AVL search tree insertion build process/delete 3 process/delete 6 process

5. Friends, friends of friends design algorithms for what in a subset

 

3. Short answer questions (25 points)

1. How does Kruskal's algorithm determine whether there is a loop

2. How to find the in-degree of all nodes in the adjacency list of the directed graph and the adjacency matrix? Algorithm idea and complexity analysis

3. Given a weighted adjacency matrix of a directed weighted graph

(1) Find a topological sequence

(2) The shortest path from A to any point and the length of the shortest path

 

4. Code questions (20 points)

1. Determine whether the binary tree has the same parent node and ancestor

(1) Algorithm idea

(2) Code

(3) Complexity

2. (Real questions from 12-13)

Write an algorithm to remove duplicate elements from a linked list. For example, to change (7,12,12,14,23) into (7,12,14,23), please write the algorithm idea and algorithm implementation and analyze the complexity of the algorithm.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324603538&siteId=291194637