会津大学 - algorithms and data structures. . . . . .1/1 algorithms and data structures course...

33
. . . . . . 1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming Chu University of Aizu 2020 - 2021 Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu Algorithms and Data Structures

Upload: others

Post on 27-Feb-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 1/1

Algorithms and Data StructuresCourse Information

Yutaka Watanobe, Jie Huang, Yan Pei,Wenxi Chen, Qiangfu Zhao, Wanming Chu

University of Aizu

2020 - 2021

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 2: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 2/1

Outline

InstructorsMaterialsScheduleAssignmentsEvaluation SchemeInstruction for Exercises

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 3: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 3/1

Instructors (Lectures)

Name E-mail Class RoomProf. Yutaka Watanobe [email protected] C1/C2 M1/M2Prof. Yan Pei [email protected] C3/C4 M3/M4Prof. Jie Huang [email protected] C5/C6, C7 LTh

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 4: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 4/1

Instructors (Exercises)

Name E-mail Class RoomProf. Yutaka Watanobe [email protected] C1 std1Prof. Wenxi Chen [email protected] C2 std2Prof. Yan Pei [email protected] C3 std3Prof. Wanming Chu [email protected] C4 std4Prof. Jie Huang [email protected] C5 std3Prof. Qiangfu Zhao [email protected] C6, C7 std4

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 5: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 5/1

Course Webpages

1 Course webpagehttp://web-ext.u-aizu.ac.jp/course/alg1

2 Source of problemshttps://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/1

3 Place to solve the problemshttps://onlinejudge.u-aizu.ac.jp/beta/room.html#UoA ALDS1 2020 {class} {topic}* full URL and links are available from the course web page

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 6: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 6/1

Text Books (1)

T.コルメン、C.ライザーソン、R.リベスト、C.シュタインアルゴリズムイントロダクション,世界標準MIT教科書,近代科学社

第1巻 第2巻

(Option)

総合版

(Option)* You should buy第1巻. Our lecture is mainly based on第1巻.*第2巻 is optional. Some advanced topics are based on第2巻.*総合版 is optional. You should consider to buy総合版 for Algorithms andData Structures II (3rd year) and for your research in the future.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 7: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 7/1

Text Books (2)

プログラミングコンテスト攻略のためのアルゴリズムとデータ構造渡部有隆, Ozy,秋葉拓哉

* This is optional. We recommend this book, if you

are not good at programming. You can consult all

solutions for exercise problems from this book.

アルゴリズムビジュアル大事典

渡部 有隆,ニコライミレンコフ

* This is optional. This is for students who are not

good at programming. You can imagine and un-

derstand algorithms and data structures visually.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 8: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 8/1

Course Schedule: 13 Topics

1 Getting Started2 Complexity, Sort I3 Elementary Data Structures4 Search5 Divide and Conquer Algorithms6 Sort II7 Tree8 Binary Search Trees9 Heaps

10 Dynamic Programming11 Graph I12 Graph II13 Heuristic Search

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 9: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 9/1

Course Schedule: 2 Examinations

1 Coding Examination- Examination conducted in exercise rooms

2 Paper Examination- Final Examination

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 10: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 10/1

Assignments

In every class (lecture and exercise), there are two different sets ofassignments.

1 [Algorithm Assignments] The first set of assignments checks yourbasic understandings of topics given in the corresponding lecture. Thispart will be conducted in the lecture and should be completed during theexercise class and then hand it in to exercise class instructors(TAs/SAs).

2 [Programming Assignments] The second set of assignments concernabout actual programming on a computer. You should write completeprograms in C, C++ or Java language to implement algorithms.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 11: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 11/1

Algorithm Assignments

The Algorithm Assignments are written assignments.Eash assignment consists of a few questions.You must show your sheet to SAs/TAs. This procedure isconsidered as your attendance record for both the lecture andexercises.SAs/TAs will evaluate your answers and marks will be givenaccording to the judgment.You can keep trying to solve the problems with TA’s instructionsto get all the answers right.The answer sheet will be returned to you so that you can consultit for solving the corresponding programming assignment.The deadline of the algorithm assignment is the end of the (2nd)exercise class.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 12: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 12/1

Programming Assignments

In each class (lecture), three or four problems will be given asprogramming assignments.You should solve at least the first two problems.If you solve the third or fourth problem, you will get higher score(please see the evaluation scheme below for details).The Programming Assignments should be achieved at Arena ofAizu Online Judge (AOJ).

See the last section for details.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 13: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 13/1

Programming Assignments: Available Languages

Although you can use any programming languages which areavailable in AOJ, we recommend C language.If you use languages other than C, please note that:

You should avoid the use of standard libraries (algorithms,containers, etc.) related to the corresponding topics.Instructors and TAs/SAs may not help to debug your programs.You should set up the programming environment on workstation byyour self when you take the coding examination.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 14: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 14/1

Guidepost

As a rough guide for programming assignments:

ID Comment DeadlineA You need to solve them for your credit. a week laterB You need to solve them for your credit. a week laterC You should solve several problems to get A. End of semesterD For fun! End of semester

Note that the deadline can be changed due to circumstances.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 15: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 15/1

Regulations

For each problem you should receive ’Accepted’ as a verdict.Your program should contain helpful comments (to TAs) thatexplain detailed structures of your algorithms and programs.All your submitted source codes will be stored in AOJ databasewith time stamps. If we find a cheat (copying others), all theexercise scores of the cheater will be zero.Make a directory alg1 at your home directory.Make directories le01, le02, ... for each lecture (topic) at the alg1.In each lecture, make source codes A.c, B.c, C.c and so on.Permission for all directory and source code must be 705.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 16: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 16/1

Scoring (1)

Category Max ScoreAT Attendance 13AA Algorithm Assignments 100PA Programming Assignments 120VL Validation 1PE Paper Examination 120CE Coding Examination 120Theory

√AA × PE

Practice√

PA × CE × VL

Final score = min(100, ⌊AT+110 ⌋ ×

√Theory × Practice)

Note that these criteria can be changed due to circumstances.Note that this is based on overmark. Do not worry about yourcredit.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 17: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 17/1

Scoring (2)

Caution!If we find a cheat (copying others), all the exercise scores ofthe cheater will be zero. (Repeat)VL is to justify scores of programming assignments.If a student copies several programs of others, his/her VL is 0.5.If a student copies several programs with malicious intention,his/her Val is 0.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 18: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 18/1

Scoring (3)

0

10

20

30

40

50

F D C B A S

Score Distribu!on

An Example: score distribution of Algo 2016

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 19: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 19/1

Teaching Policy

In the lecture, only selected topics (theory and knowledge) aregiven.In the assignments for both algorithms and programming:

Think + Solve + Implement

Instructors and TAs/SAs are ready to help you.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 20: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 20/1

Instruction for Exercises

At the beginning of semester, make a user account of AizuOnline Judge (AOJ).For each exercise:

1 Visit the corresponding ’room’ of Arena. You can visit the roomfrom the course web page.

2 Enter in the room and solve problems.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 21: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 21/1

AOJ: Registration (1)

Visit https://onlinejudge.u-aizu.ac.jp/signup

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 22: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 22/1

AOJ: Registration (2)

Input your information and register. Please use your student IDfor the Account ID.If you are already heavy user of AOJ and want to use your AOJID for this course, you can use it. In this case, please inform yourID to your TAs/SAs as well as to the coordinator([email protected]).Source Code Policy should be ’public’ so that all user canconsult your solution.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 23: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 23/1

AOJ: Terms of Use

Prohibit submissions for purposes other than problem solving.Intentional use of restricted operations as well as any malevolentprogram will be considered as attacks on the judge systems. Ifwe find the intentional attack, we may refuse submissions fromthe corresponding users.You acknowledge and agree that WEB service and judge maystop because of system maintenance or trouble.You acknowledge and agree that public source codes may beopened collectively to a person authorized to access only foreducational or research purposes.You acknowledge and agree that source code submitted may beused by University of Aizu and related research institutes only foreducational or research purposes.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 24: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 24/1

Arena: Home

You can reach to the arena room from the course web page.In the home, you can check general information of the exercise.Please enter in the room from Entry button for each exercise (you need to sign-in).

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 25: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 25/1

Arena: Problems

You can see a list of problems to be solved.Click the panel to see problem description.Click the submit icon (paper plane) to submit your program.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 26: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 26/1

Arena: Description

Please read the problem description.

Note that you should write program in your local environment.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 27: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 27/1

Arena: Workspace

From submit icon or button of the problem panel or problem description, you can move tothe workspace.Select your program from Choose File and submit it to the judge. You can receive the statusof your program immediately.Click the submit button to submit your program.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 28: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 28/1

Arena: Workspace - Status

Please see the details of the status:https://onlinejudge.u-aizu.ac.jp/judges replies

CE: Compile Error, Compiler the judge uses has failed to compile your program. Please seeerror messages from the judge. If you need, please see the version of compilers at SystemInformation.

RE: Runtime Error, Your program has failed during the execution. Possible causes includes:out of range in pointer reference (Segmentation Fault), stack overflow (infinite recursivefunctions), division by zero and many others. Note that, the main function in C languageshould return 0.

TLE: Time Limit Exceeded, The CPU time your program has run has exceeded the time limitspecified for the corresponding problem.

MLE: Memory Limit Exceeded, The maximum amount of memory that your program hasused has exceeded the limit specified for the corresponding problem.

WA: Wrong Answer, Your program has produced the output which is different from the judgedata.

PE: Presentation Error, Your program is almost accepted but not perfect. Your programoutputs extra spaces or blank lines, and/or does not output required spaces or blank lines.

AC: Accepted, Your program has been ”accepted” since it has not failed into all the abovementioned conditions.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 29: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 29/1

Arena: Workspace - Testcase

You can check testcases (judge data) for debugging.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 30: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 30/1

Arena: Scoreboard

This is optional. You can see status of others on the scoreboard.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 31: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 31/1

AOJ: Courses* This is optional.

All exercise problems are from the AOJ course of Algorithms and Data Structures.If you are not good at programming, you can review Introduction to Programming.If you are bored, you can try advanced topics.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 32: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 32/1

AOJ: Topics

* This is optional.

You can check your scores and status of a selected course.

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures

Page 33: 会津大学 - Algorithms and Data Structures. . . . . .1/1 Algorithms and Data Structures Course Information Yutaka Watanobe, Jie Huang, Yan Pei, Wenxi Chen, Qiangfu Zhao, Wanming

. . . . . . 33/1

Contact Info.

If you find any problems and have suggestions for AOJ and Arenasystem, please contact the development team ([email protected])or TAs/SAs in your exercise rooms. Thank you very much for yourcooperation!

Y. Watanobe, J. Huang, Y. Pei, W. Chen, Q. Zhao, W. Chu University of Aizu

Algorithms and Data Structures