2021 Shandong University Introduction to Algorithms Exam Recall Edition

2021SC@SDUSC

one

(1) Explain the three symbols of the time complexity of the algorithm - Θ, Ω, Ο
(2) T(n)=T(3n/4)+nlogn, calculate the time complexity of T(n)
(3) Prove that the vertex cover problem is NP-complete

two

(1) Find a strongly connected branch, prove its correctness, time complexity
(2) On the basis of the existing minimum spanning tree, increase the weight of a random edge to find a new update algorithm for the minimum spanning tree. Write pseudocode and prove its correctness.

three

(1) Three relevant proofs for finding the shortest path

1. The subpath of the shortest path is also the shortest path

2. For all the shortest paths between any two points, there is always a finite length

3. Prove the triangle inequality

(Probably these three, hey)

(2) Floyd-Warshall algorithm (multi-source shortest path problem) explains its related ideas, completes (updates) the adjacency matrix, and writes the shortest path

Four

(1) There are n piles of chess pieces from left to right, each pile has several pieces, only adjacent piles of chess pieces can be merged, and the cost of merging is the number of pieces in the merged pile.
Now we need to combine these n piles of chess pieces into one pile, and give an algorithm with the least cost. Write pseudocode and prove its correctness.
(2) There is an interval set N with several closed intervals in the middle. There is a point set P (number set), if any number contained in P is contained in a closed interval, the interval is said to be hit.
Minimum hit set: If for any interval in N, there is a point in P that can hit the set, and the points in P are required to be as few as possible.
Give an algorithm to find the minimum number of points in P, write out the pseudo code, and prove its correctness.

(In fact, there is another picture here to help understand, but unfortunately I did not find the same problem, so I will add a similar one below)

Similar problem: Suppose there are the following radio stations that need to be paid, and the areas where the radio station signals can cover. How to choose the fewest radio stations so that all areas can receive the signal

similar problem

Note: The original title of the underlined question is in English (there should be more than these two questions, in short, English can be basically understood, and it will not embarrass the candidates)

Guess you like

Origin blog.csdn.net/qq_50861917/article/details/122113365