大学MOOC 数据结构与数据库技术(山东大学)1462541166 最新慕课完整章节测试答案
Basic Data Structures
Basic Data Structures
1、单选题:
Which of the basic data structures is the most suitable if you need to access its elements by their positions in O(1) time (this is called random access)?
选项:
A: Queue
B: Stack
C: Array
D: List
答案: 【 Array】
2、单选题:
第 2 个问题Which of the basic data structures is the most suitable if you want to be able to insert elements in the middle in O(1) time?
选项:
A: Queue
B: Stack
C: Array
D: List
答案: 【 List】
3、单选题:
Which of the basic data structures is the most suitable if you only need to insert the elements in the back and to extract elements from the front?
选项:
A: Stack
B: Queue
C: Array
D: List
答案: 【 Queue】
4、单选题:
Which of the basic data structures is the most suitable if you only need to implement recursion in a programming language? When you make a recursive call, you need to save the function you are currently in and its parameters values in some data structure, so that when you go out of the recursion you can restore the state. When you go out of the recursive call, you will always need to extract the last element that was put in the data structure.
选项:
A: Tree
B: Queue
C: Stack
D: Array
答案: 【 Stack】
5、单选题:
Which of the basic data structures is the most suitable if you need to store the directory structure on your hard drive?
选项:
A: Queue
B: List
C: Stack
D: Tree
答案: 【 Tree】
Divide and Conquer
Greedy Algorithms
1、单选题:
第 2 个问题In the previous problem, what is the subproblem you need to solve after you've made a safe move?
选项:
A: Choose projects with highest payment to work on from the pool of projects which now contains only 9 projects.
B: Determine the order in which to work on the selected projects.
C: Compute the sum of payoffs you will get when you complete the selected projects.
D: None of above.
答案: 【 Choose projects with highest payment to work on from the pool of projects which now contains only 9 projects.】
2、多选题:
第 1 个问题You work as a freelancer and have a pool of 10 projects to work on. For each project you know how much money you will get for completing the project. You can complete any 3 projects this month. You want to select such projects that you will get the most money by completing them. What are the safe moves in this problem? (Mark all that apply.)
选项:
A: Take the project with the highest payment for completion, complete it and remove it from the pool of projects.
B: Take the project for which you can apply the cool new technology that you've recently learned about.
C: Take the project which you like the most.
D: If there are more than 3 projects in the pool, remove the project with the lowest payment for completion, don't work on this project. In the other case, remove the first project from the pool and work on this project.
答案: 【 Take the project with the highest payment for completion, complete it and remove it from the pool of projects.;
If there are more than 3 projects in the pool, remove the project with the lowest payment for completion, don't work on this project. In the other case, remove the first project from the pool and work on this project.】
3、判断题:
You need to find an integer
with the largest product of digits. Yo
