Analysis of Algorithms - Modules 1 to 3

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/53

flashcard set

Earn XP

Description and Tags

Comprehensive practice flashcards defining essential terminology, algorithms, complexity bounds, and recurrence methods covered across Modules 1 to 3.

54 Terms

1
New cards

Algorithm

A step-by-step procedure and set of rules defined in a specific order to carry out a predefined computation or solve a problem.

2
New cards

Definiteness

An algorithm property requiring all instructions to be unambiguous, simple to interpret, concise, and precise, leaving no room for multiple interpretations.

3
New cards

Finiteness

An algorithm property stating that every algorithm must terminate after a finite number of steps, ensuring loops have finite bounds and recursive calls possess well-defined base cases.

4
New cards

Effectiveness

An algorithm property requiring operations to be basic enough to be performed exactly using elementary operations, analogous to pencil-and-paper computation.

5
New cards

Space Complexity

The amount of memory required by an algorithm to execute and solve a problem, governed by fixed-size components (instructions, constants) and variable-size components (recursion stack, dynamic structures).

6
New cards

Time Complexity

The measure of time taken by an algorithm to solve a problem, expressed as a function of the number of primitive operations performed rather than physical clock time.

7
New cards

Primitive Operation

The most frequent fundamental operation appearing in an algorithm (such as comparison in sorting or addition in matrix sum) that forms the dominant cost component.

8
New cards

Order of Growth

The relationship between input size nn and algorithm performance, describing how rapidly the running time grows as input size increases.

9
New cards

Big Oh Notation (OO)

An asymptotic notation providing an upper bound for execution time; f(n)=O(g(n))f(n) = O(g(n)) if there exist positive constants cc and n0n_0 such that 0≤f(n)≤c⋅g(n)0 \le f(n) \le c \cdot g(n) for all n≥n0n \ge n_0.

10
New cards

Big Omega Notation (Ω\Omega)

An asymptotic notation providing a lower bound for execution time; f(n)=Ω(g(n))f(n) = \Omega(g(n)) if there exist positive constants cc and n0n_0 such that 0≤c⋅g(n)≤f(n)0 \le c \cdot g(n) \le f(n) for all n≥n0n \ge n_0.

11
New cards

Big Theta Notation (Θ\Theta)

An asymptotic notation providing an asymptotically tight bound; f(n)=Θ(g(n))f(n) = \Theta(g(n)) if there exist positive constants c1c_1, c2c_2, and n0n_0 such that 0≤c1⋅g(n)≤f(n)≤c2⋅g(n)0 \le c_1 \cdot g(n) \le f(n) \le c_2 \cdot g(n) for all n≥n0n \ge n_0.

12
New cards

Crossover Point (n0n_0)

The threshold value of problem size nn beyond which a function f(n)f(n) strictly stays within the bound established by c⋅g(n)c \cdot g(n).

13
New cards

Intractable Problem

A problem that can theoretically be solved but requires an unacceptably large, computationally infeasible amount of time, giving it no practical application.

14
New cards

Tractable Problem

A problem that can be solved theoretically and practically within a reasonable amount of time, specifically in polynomial time O(p(n))O(p(n)) by a deterministic Turing machine.

15
New cards

Decision Problem

A computational problem that produces a Boolean output of either 'Yes' or 'No' for any given input instance.

16
New cards

Optimization Problem

A computational problem seeking the best solution (such as maximum profit or least cost) from the entire set of feasible solutions.

17
New cards

P Problems (PTIME / DTIME)

The class of problems that can be solved in polynomial time by deterministic algorithms.

18
New cards

NP Problems

The class of problems solvable in non-deterministic polynomial time, operating with a non-deterministic guessing stage and a deterministic polynomial-time verification stage.

19
New cards

Polynomial-Time Reducibility (A≤pBA \le_p B)

A transformation mapping input xx of decision problem AA to input f(x)f(x) of problem BB in polynomial time such that f(x)f(x) is 'Yes' for BB if and only if xx is 'Yes' for AA.

20
New cards

NP-Complete (NPC) Problem

A decision problem CC that is in class NP, where every problem XX in NP is reducible to CC in polynomial time (X≤pCX \le_p C).

21
New cards

NP-Hard Problem

A problem to which every problem in NP can be reduced in polynomial time, regardless of whether it belongs to NP or is a decision problem.

22
New cards

Vertex Cover

A subset of vertices V′⊆VV' \subseteq V in a graph G=(V,E)G = (V, E) such that every edge (u,v)∈E(u, v) \in E has at least one endpoint incident in V′V'.

23
New cards

Clique

A complete subgraph of a graph GG in which an edge exists between every distinct pair of vertices.

24
New cards

Selection Sort

An in-place, comparison-based sorting algorithm that iteratively selects the minimum element from the unsorted sublist and swaps it into its correct position, taking Θ(n2)\Theta(n^2) time across all cases.

25
New cards

Insertion Sort

An in-place, incremental sorting algorithm that builds a sorted array by inserting one unsorted element at a time into its proper place by shifting larger elements to the right.

26
New cards

Insertion Sort Simulation on Array

An 8-step simulation demonstrating how each incoming number is compared, larger elements are shifted right, and the number is inserted into its correct position.

<p>An 8-step simulation demonstrating how each incoming number is compared, larger elements are shifted right, and the number is inserted into its correct position.</p>
27
New cards

Recurrence Equation

An equation that recursively defines a function or sequence using smaller argument values, commonly representing the running time of recursive algorithms.

28
New cards

Forward Substitution

A recurrence solving method that computes the solution of progressively larger problems starting from the base condition until problem size nn is solved.

29
New cards

Backward Substitution

A recurrence solving method that repeatedly replaces T(n)T(n) with expressions involving T(n−1)T(n-1), T(n−2)T(n-2), and so on until it reaches the base condition.

30
New cards

Recursion Tree

A tree structure where each node represents the cost of an individual subproblem at a given level of recursion, allowing the total cost to be calculated by summing all levels.

31
New cards

Master Method

An algorithmic tool used to quickly solve recurrences of the form T(n)=a⋅T(n/b)+f(n)T(n) = a \cdot T(n/b) + f(n) by comparing f(n)f(n) to nlog⁡b(a)n^{\log_b(a)}.

32
New cards

Divide and Conquer

A top-down recursive design paradigm that breaks a problem into smaller independent subproblems (Divide), solves them recursively (Conquer), and merges their results into a solution (Combine).

33
New cards

In-place Sorting

A sorting algorithm characteristic where sorting requires only a constant amount of additional memory (O(1)O(1)) beyond the input array.

34
New cards

Stable Sorting

A sorting algorithm characteristic ensuring that elements with equal key values retain their relative original input order in the sorted output.

35
New cards

Two-Way Merge

The process of combining two sorted arrays of size mm and nn into a single sorted array of size (m+n)(m + n) using linear comparisons.

36
New cards

Merge Sort

A divide-and-conquer sorting algorithm that splits an array into two halves, recursively sorts each half, and merges them in linear time, yielding Θ(nlog⁡2(n))\Theta(n \log_2(n)) complexity across all cases.

37
New cards

Quick Sort (Partition Exchange Sort)

A divide-and-conquer algorithm invented by Tony Hoare that chooses a pivot, partitions elements such that smaller values precede the pivot and larger values succeed it, and sorts subarrays recursively.

38
New cards

Randomized Quick Sort

A variant of quicksort that selects a pivot randomly to avoid worst-case O(n2)O(n^2) behavior on sorted or nearly sorted inputs, achieving expected O(nlog⁡2(n))O(n \log_2(n)) time.

39
New cards

Binary Search

A divide-and-conquer search algorithm on sorted arrays that tests the target key against the middle element, reducing the search space by half each iteration to run in O(log⁡2(n))O(\log_2(n)) time.

40
New cards

Ternary Search

A search algorithm that divides a sorted array into three equal parts using two cut points (oneThird and twoThird), exhibiting a worst-case running time of Θ(log⁡(n))\Theta(\log(n)).

41
New cards

Min-Max Problem (Divide and Conquer)

An algorithm that finds the maximum and minimum elements in an array simultaneously by recursively splitting the array, requiring only (3n2−2)(\frac{3n}{2} - 2) comparisons.

42
New cards

Strassen's Matrix Multiplication

A divide-and-conquer algorithm that multiplies two n×nn \times n matrices using 7 submatrix multiplications instead of 8, achieving a time complexity of O(nlog⁡2(7))≈O(n2.81)O(n^{\log_2(7)}) \approx O(n^{2.81}).

43
New cards

Greedy Algorithm

A problem-solving paradigm that builds a solution step by step by making locally optimal, irrevocable choices at each stage without reconsidering past decisions.

44
New cards

Greedy Choice Property

The property that a globally optimal solution can be assembled by making sequential locally optimal choices at each decision point.

45
New cards

Optimal Substructure

The property that an optimal solution to a problem contains within it the optimal solutions to its constituent subproblems.

46
New cards

Dijkstra's Algorithm

A greedy algorithm that finds the shortest path from a single source vertex to all other vertices in a weighted graph with non-negative edge weights in O(∣V∣2)O(|V|^2) time.

47
New cards

Fractional Knapsack Problem

A knapsack problem variant where items can be divided into fractions, solved optimally by a greedy strategy that sorts and selects items by decreasing profit-to-weight ratio (vi/wiv_i / w_i).

48
New cards

0/1 Knapsack Problem

A knapsack problem variant where each item must either be fully included or completely excluded; greedy heuristics fail to guarantee an optimal solution for this variant.

49
New cards

Job Sequencing with Deadlines

An optimization problem of scheduling unit-time jobs with deadlines and profits on a single processor, solved greedily by ordering jobs by decreasing profit and scheduling each in its latest free feasible slot.

50
New cards

Spanning Tree

A connected, acyclic subgraph of a connected, undirected graph G=(V,E)G = (V, E) that contains all vertices VV and a subset of edges E′⊆EE' \subseteq E with cardinality ∣V∣−1|V| - 1.

51
New cards

Minimum Spanning Tree (MST)

A spanning tree of a weighted, connected, undirected graph that possesses the minimum possible sum of edge weights.

52
New cards

Prim's Algorithm

A greedy algorithm that constructs an MST starting from an arbitrary vertex by repeatedly adding the minimum-weight edge connecting the current tree to an unvisited vertex; optimal for dense graphs.

53
New cards

Kruskal's Algorithm

A greedy algorithm that constructs an MST by sorting all edges by weight and iteratively adding the minimum-weight edge that does not create a cycle using Disjoint Set (Union-Find) operations.

54
New cards

Mean Retrieval Time (MRT)

The average time required to retrieve programs stored on a tape, which is minimized by ordering programs in non-decreasing order of their lengths.