Try   HackMD

APCS 大學程式能力檢定考前衝刺


"如你根本並無招式,
敵人如何來破你的招式?"
-- 風清揚
笑傲江湖第十回傳劍

''Why do we fall sir?
So that we can learn to pick ourselves up.''
-- Alfred Pennyworth
Batman Begins (2005)

課前訊息

主講者

  • 盧政良 (Zheng-Liang Lu, Arthur)
  • 電子信箱:arthurzllu@gmail.com

預備知識

工作環境

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

電子郵件通訊禮節

  • 電子郵件的標題 (Title) 需要註明班別中文姓名,並加上信件主旨,如:APCS-nnn 金城武 作業繳交。
  • 利用電子郵件提問時,務必提供完整的訊息,諸如:問題敘述、曾經嘗試但是失敗的方案、可能的猜想等等。任何有助於了解問題的材料皆可附上,如程式碼、錯誤訊息的截圖。

常用指令

# C 的編譯指令 gcc -g -O2 -std=gnu99 -static -lm -o a.out <your_source_code> # C 的執行指令 ./a.out # C++ 的編譯指令 g++ -g -O2 -std=gnu++11 -static -lm -o a.out <your_source_code> # C++ 的執行指令 ./a.out # Java 的編譯指令 javac <your_source_code> # Java 的執行指令 java -client -Xss8m -Xmx1024m <basename_of_source_code> # Python 的編譯指令 python3 a.py

課程錄影

  • 本課程除非經授課老師同意,學生得擅自進行課程錄音與錄影。

課程架構

流程控制 (Flow Controls)

  • 有條件的敘述 (conditional statements) / 分支 (branching)
    • if-else if-else
    • switch-case-default
  • 迴圈 (loops)
    • while / do-while loops
    • for loops
    • 多層迴圈的結構
  • 演算法分析 (analysis of algorithms)

陣列 (Arrays)

  • 基本語法
  • 陣列的第一個元素為何從 0 開始? 這得從記憶體 (memory) 配置說起
  • 二維陣列
  • 動態配置與堆積 (heap)
  • 指標 (pointer) 與陣列

函式與遞迴 (Functions and Recursion)

常見的演算法與工具

... #include <bits/stdc++.h> ...
  • 排序 (sort)
  • 二元搜尋法 (binary search)
  • 前綴和 (prefix sum)
  • 二元樹 (binary tree) 的走訪 (traversal) pdf
  • 無向圖有向圖上做搜尋
    • 深度優先搜尋演算法 (DFS)
    • 寬度優先搜尋演算法 (BFS)
  • 動態規劃 (dynamic programming, DP) pdf
  • 貪心演算法 (greedy algorithms) pdf

補充材料

書籍

  • 劉邦鋒,由重構學習 C++ 程式設計,2023
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
  • 劉邦鋒,由片語學習 C 程式設計,2019
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein, Introduction to Algorithms, 4/e, 2022
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
  • Robert Sedgewick and Kevin Wayne, Algorithms, 4/e, 2011

Standard Template Library (STL)

大學課程

教學平台 / 題庫

跟課堂有關的電影/影集

與程式設計相關的遊戲