ข้ามไปยังเนื้อหา

Recursion

แนะนำใหม่
เอกสารประกอบการเรียน
บทเรียนวิดีโอสำหรับหัวข้อนี้ เปิดหน้าวิดีโอ
15:34

การค้นหา & การเรียงลำดับ

สมุดโทรศัพท์ที่มีชื่อหนึ่งล้านชื่อ หากคุณตรวจสอบทีละชื่อ อาจต้องเปรียบเทียบถึงหนึ่งล้านครั้ง แต่คุณรู้เทคนิคอยู่แล้ว: เปิดมันใน…

บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้

ในบทเรียนนี้

บทเรียนวิดีโอ
คำศัพท์
English ความหมาย
recursive/rɪˈkɜːsɪv/แบบเรียกซ้ำ
loop/luːp/A structure that repeats a sequence of instructions.
base case/beɪs keɪs/กรณีพื้นฐาน
recursive case/rɪˈkɜːsɪv keɪs/กรณีเรียกซ้ำ
recursive call/rɪˈkɜːsɪv kɔːl/A function call made by the same function while it is running.
trace/treɪs/To follow an algorithm step by step and record its values.
call stack/kɔːl stæk/
recursion/rɪˈkɜːʃn/The use of a rule inside its own definition to express repetition.
function/ˈfʌŋkʃn/A mapping that assigns exactly one output to each allowed input.
Winding upThe stage when recursive calls are made until a base case is reached.
UnwindingThe stage when recursive calls return their results to the calls waiting for them.
stack/stæk/A last-in, first-out data structure in which items are added and removed at the same end.
parameters/pəˈræmɪtəz/Values that specify a model or function, or named inputs that a subroutine receives.
local variables/ˈləʊkl ˈveərɪəblz/A variable whose name is accessible only within a particular function, block or other limited scope.
stack frame/stæk freɪm/เฟรมสแต็ก
return address/rɪˈtɜːn əˈdres/The location where execution should resume after a called routine finishes, saved as part of managing the call.
pushedAdded to the top of the call stack when a function is called.
poppedRemoved from the top of the call stack when a function returns.
ADTA description of data and its allowed operations, separate from how it is stored.
memory/ˈmeməri/The part of a computer that holds data and programs currently in use.
stack overflow/stæk ˌəʊvəˈfləʊ/สแต็กโอเวอร์โฟลว์
Deep recursionEven a correct recursion of a million levels needs a million frames, so it can exhaust memory where a loop would use none.
FibonacciA sequence starting with zero and one, where each later number is the sum of the previous two.
memoisation/ˌmeməʊaɪˈzeɪʃn/การจำแนกผลลัพธ์
iteration/ˌɪtəˈreɪʃn/Repeating a sequence of instructions or calculations.
self-similarDescribes a problem that contains a smaller version of itself.
tree traversalThe process of visiting each node in a tree in a particular order.
divide and conquer/dɪˈvaɪd ænd ˈkɒŋkə/A method that divides a problem into smaller problems and combines their solutions.
binary search/ˈbaɪnəri sɜːtʃ/A search of ordered data that repeatedly compares with the middle item and discards half of the remaining search range.
merge sort/mɜːdʒ sɔːt/A sorting algorithm that divides data into smaller parts, sorts them, and joins them in order.
arithmetic overflowA result that is too large or small for the available number of bits.
infinite recursionWhen a function keeps calling itself because it never reaches a stopping point.

เอกสารประกอบการเรียน

IGCSE, A-Level & AP