-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8843408
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
GNUmakefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
project(hellocmake LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
add_executable(main main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# 高性能并行编程与优化 - 第0x讲的回家作业 | ||
|
||
通过 pull request 提交作业。会批分数,但是: | ||
|
||
没有结业证书,回家作业仅仅作为评估学习效果和巩固知识的手段,不必为分数感到紧张 :) | ||
量力而行,只要能在本课中,学到昨天的自己不懂的知识,就是胜利,没必要和别人攀比。 | ||
注意不要偷看别人的作业哦! | ||
|
||
- 课件:https://github.com/parallel101/course | ||
- 录播:https://space.bilibili.com/263032155 | ||
|
||
作业提交时间不限 :) 即使完结了还想交的话我也会看的~ 不过最好在下一讲开播前完成。 | ||
|
||
- 如何开 pull request:https://zhuanlan.zhihu.com/p/51199833 | ||
- 如何设置 https 代理:https://www.jianshu.com/p/b481d2a42274 | ||
|
||
## 评分规则 | ||
|
||
- 完成作业基本要求 50 分(详见下方"作业要求") | ||
- 能够在 PR 描述中用自己的话解释 25 分 | ||
- 代码格式规范、能够跨平台 5 分 | ||
- 有自己独特的创新点 20 分 | ||
- 明显抄袭现象 -100 分 | ||
|
||
## 作业要求 | ||
|
||
修改 main.cpp,改良其中的双链表类 `List`: | ||
|
||
- 避免函数参数不必要的拷贝 5 分 | ||
- 修复智能指针造成的问题 10 分 | ||
- 改用 `unique_ptr<Node>` 10 分 | ||
- 实现拷贝构造函数为深拷贝 15 分 | ||
- 说明为什么可以删除拷贝赋值函数 5 分 | ||
- 改进 `Node` 的构造函数 5 分 | ||
|
||
并通过 `main()` 函数中的基本测试。 | ||
|
||
## 关于内卷 | ||
|
||
如果你把 List 改成了基于迭代器的,或是作为模板 `List<int>`: | ||
只要是在 **满足作业要求的基础** 上,这是件好事! | ||
老师会酌情加分,视为“独特的创新点”,但最多不超过 20 分。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <cstdio> | ||
|
||
int main() { | ||
printf("Hello, world!\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
cmake -B build | ||
cmake --build build | ||
build/main |