CS401A's Prelims: Design and Analysis of Algorithms Flashcards

For preliminary exams. (52 cards)

1
Q

Review of Algorithms

“A computer is a stupid machine
with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things.”

A

According to Bill Bryson,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Review of Algorithms

A set of finite and detailed step-by-step instructions performed to complete a specific task is what we call an

A

algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Review of Algorithms

Did you know that the word algorithm comes from Persian scientist, mathematician, and author

A

Abu Abdullah
Muhammad bin Musa al-Khwarizmi
,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Review of Algorithms

on the other hand, is the design and analysis of computer algorithms.

A

Algorithmics,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Review of Algorithms

pertains to the method or mathematical process behind the conception of an algorithm

A

The design part

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Review of Algorithms

while the
deals with the determination of the
computational complexity of an algorithm.

A

analysis part

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Review of Algorithms

starts from defining the
problem cautiously by describing the set of instances

A

Notion of Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Review of Algorithms

The algorithm
will often be divided into sections:

A

Parts/Components (Input)

Actions/Steps/Methods (Processing)

Outcome (Output)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Review of Algorithms

Characteristics of Algorithm
For an algorithm to be useful, it must help find the solution to a specific problem. For that to happen, an algorithm must satisfy five (5) properties.

A
  1. Input Specification
  2. Output Specification
  3. Definiteness
  4. Finiteness
  5. Effectiveness
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Review of Algorithms

Characteristics of Algorithm

The inputs must be clearly
identified.

A
  1. Input Specification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Review of Algorithms

Characteristics of Algorithm

The output, as well as its
relationship to the input/s, must be clearly
identified

A
  1. Output Specification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Review of Algorithms

Characteristics of Algorithm

The steps in the algorithm must be
precisely defined;

A
  1. Definiteness
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Review of Algorithms

Characteristics of Algorithm

The algorithm must always come to an
end after a finite number of steps and using a finite
amount of resources.

A
  1. Finiteness
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Review of Algorithms

Characteristics of Algorithm

All operations to be performed
must be sufficiently basic that they can be done
exactly and in finite time.

A
  1. Effectiveness
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Review of Algorithms

Representation of Algorithm
An algorithm is represented using two (2) common
techniques:

A
  • Pseudocode
  • Flowchart
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Review of Algorithms

_____ means imitation

A

Pseudo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Review of Algorithms

_____ refers to instructions written in a programming
language.

A

code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Review of Algorithms

This term is a generic way of describing an algorithm without using any specific
programming language-related notations.

A

Pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Review of Algorithms

It is a method of expressing an algorithm
by a collection of connected geometric shapes containing descriptions of the algorithm’s steps.

A

Flowchart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Review of Algorithms

Common Pseudocode Notation
There is no strict set of standard notations for
pseudocode, but the most widely recognized are:

A

Input
Output
If-Then-Else
For
Repeat-Until
While

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Review of Algorithms

- indicates a user will be inputting
something.

22
Q

Review of Algorithms

- indicates that an output will
appear on the screen.

23
Q

Review of Algorithms

- a decision (selection) in which a choice is made any instructions that occur inside a selection or iteration are usually indented.

A

If-Then-Else

24
Q

Review of Algorithms

- a counting loop (iteration)

25
# **Review of Algorithms** `-` a loop (iteration) that has a condition at the end.
○ *Repeat-Until*
26
# **Review of Algorithms** `-` a loop (iteration) that has a condition at the beginning
○ *While*
27
# **Review of Algorithms** **Algorithm design and analysis process**
1. *Understanding the problem completely.* 2. *Deciding on the computational device, data structures, and algorithm design technique.* 3. *Designing an Algorithm and Data Structure* 4. *Proving the correctness of algorithm* 5. *Analyzing the Algorithm* 6. *Coding the Program for Implementation*
28
# **Review of Algorithms** *Different Types of Problems Encountered in Designing and Analyzing Algorithms*
* *Sorting Problem* * *Searching Problem* * *String Processing Problem* * *Graph Problem* * *Combinatorial problems* * *Geometrical problems* * *Numerical problems*
29
# **Review of Algorithms** — This asks to rearrange the items of a given list in ascending order.
* *Sorting Problem*
30
# **Review of Algorithms** — It deals with finding a given value called the “search key” in a given list or set.
* *Searching Problem*
31
# **Review of Algorithms** It deals with non-numerical data that intensifies the interest of researchers and computing practitioners in string-handling algorithms.
* *String Processing Problem*
32
# **Review of Algorithms** is a sequence of characters from an alphabet.
A **string**
33
# **Review of Algorithms** * *String Processing Problem* Strings of particular interest are as follows:
○ Text strings ○ Bit strings ○ Gene sequences
34
# **Review of Algorithms** comprise letters, numbers, and special characters .
○ Text strings
35
# **Review of Algorithms** comprise zeros and ones.
○ Bit strings
36
# **Review of Algorithms** can be modeled by strings of characters from the four-character alphabet {A, C, G, T}.
○ Gene sequences
37
# **Review of Algorithms** — It deals with objects and their connections ## Footnote like determining whether all of the locations are connected, visiting all of the locations that can be reached from a given location, or finding the shortest path from one (1) location to another.
* *Graph Problem*
38
# **Review of Algorithms** — It deals with how one can reach all the points in a network.
`>` *Graph-traversal algorithms*
39
# **Review of Algorithms** is a traversing algorithm where one should start traversing from a selected node (source or starting node) and traversing the graph layerwise,
— Breadth First Search (BFS)
40
# **Review of Algorithms** is a recursive algorithm that uses the idea of backtracking.
— Depth First Search (DFS)
41
# **Review of Algorithms** means that when one is moving forward, and there are no more nodes along the current path, s/he moves back on the same path to find nodes to traverse.
The word “backtrack”
42
# **Review of Algorithms** — It deals with what is the best route between two (2) cities.
`>` *Shortest-path algorithms*
43
# **Review of Algorithms** — It deals with a set of courses with their prerequisites consistent or self-contradictory
`>` *Topological sorting for graphs with directed edges*
44
# **Review of Algorithms** — It’s about finding the right arrangement (like a permutation, combination or subset) that meets specific rules and has a desired feature. Tough computing stuff.
* *Combinatorial problems*
45
# **Review of Algorithms** — It deals with the most difficult problem in computing that ask to find a combination of an object such as permutation, combination, or a subset that satisfies certain constraints and has some desired property. | (explicitly or implicitly)
* *Combinatorial problems*
46
# **Review of Algorithms** — It deals with finding the shortest tour through 𝑛 cities that visits every city exactly once.
* *Combinatorial problems* ○ *Traveling Salesman Problem (TSP)*
47
# **Review of Algorithms** — It deals with assigning the smallest number of colors to the vertices of a graph so that no two (2) adjacent vertices are the same color.
* *Combinatorial problems* ○ *Graph-coloring problem*
48
# **Review of Algorithms** It deals with geometric objects such as points, lines, and polygons.
* *Geometrical problems*
49
# **Review of Algorithms** *Two (2) Classic Problems of Computational Geometry*
○ *Closest-pair problem* ○ *Convex-hull problem*
50
# **Review of Algorithms** given 𝑛 points in the plane, find the closest pair among them.
○ *Closest-pair problem*
51
# **Review of Algorithms** asks to find the smallest convex polygon that would include all the points of a given set.
○ *Convex-hull problem*
52
# **Review of Algorithms** — It involves mathematical objects of continuous nature ## Footnote such as solving equations, system equations, computing definite integral, evaluating functions, etc.
* *Numerical problems*