2024-02-03 03:36:20 +00:00
---
2024-02-09 18:50:56 +00:00
title: Algorithms
2024-02-24 02:43:29 +00:00
TARGET DECK: Obsidian::STEM
FILE TAGS: algorithm
2024-02-12 17:18:47 +00:00
tags:
- algorithm
2024-02-03 03:36:20 +00:00
---
2024-02-24 02:43:29 +00:00
## Overview
An **incremental** approach to algorithm design involves acting on a single element at a time. In contrast, the **divide-and-conquer** approach breaks problems into subproblems that are easier to solve.
%%ANKI
Basic
What does an incremental approach to algorithm design refer to?
Back: An algorithm that acts on a single element at a time.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467144 -->
END%%
%%ANKI
Basic
What does a divide-and-conquer approach to algorithm design refer to?
Back: An algorithm that breaks a problem into similar but simpler subproblems.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467147 -->
END%%
%%ANKI
Basic
What does it mean for a divide-and-conquer algorithm to "bottom out"?
Back: An input that cannot (or should not) be divided any further is encountered.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467151 -->
END%%
%%ANKI
Basic
In the context of algorithms, what does a "sentinel" refer to?
Back: A special value used to simplify code.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467155 -->
END%%
%%ANKI
Cloze
Insertion sort is to an {incremental} design approach whereas merge sort is to a {divide-and-conquer} design approach.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467159 -->
END%%
%%ANKI
Basic
What ideas does the term "divide-and-conquer" invoke?
Back: Breaking a problem into subproblems that are easier to solve.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467164 -->
END%%
%%ANKI
Basic
According to Cormen et al., what three steps do divide-and-conquer algorithms take?
Back: Divide, conquer, and combine.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467167 -->
END%%
%%ANKI
Basic
What is the "divide" step of a divide-and-conquer algorithm?
Back: Breaking the problem into smaller instances of the same problem.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467172 -->
END%%
%%ANKI
Basic
What is the "conquer" step of a divide-and-conquer algorithm?
Back: Solving subproblems recursively or, if small enough, in a straightforward manner.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467178 -->
END%%
%%ANKI
Basic
What is the "combine" step of a divide-and-conquer algorithm?
Back: Manipulating solutions to smaller problems into a solution for the original problem.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467182 -->
END%%
%%ANKI
Basic
What is a running time recurrence?
Back: A formula that describes overall running time in terms of running time on smaller inputs.
2024-03-19 00:28:34 +00:00
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
2024-02-24 02:43:29 +00:00
<!-- ID: 1708742467187 -->
END%%
2024-03-22 15:26:41 +00:00
## Bibliography
2024-02-24 02:43:29 +00:00
2024-03-19 00:28:34 +00:00
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).