PROJECTENGRAM

ALGORITHM

Algorithm

Tags: #◇CCDSALG #◇Algorithms #◇Computer Science #◇Computational Complexity #◇Efficiency #◇Algorithm Design Paradigms #◇Data Structures #◇Time Complexity #◇Space Complexity


◇Overview

Understanding what constitutes an algorithm.

◇Key Concepts

Definition Characteristics Input Output Definiteness

◇Details / Theory

Understanding what constitutes an algorithm.
Definition: Any well-defined computational procedure that takes value(s) as input and produces value(s) as output in a finite amount of time. (Handout 01, Page 2) Characteristics:
Input: Zero or more quantities are externally supplied.
Output: At least one quantity is produced.
Definiteness: Each instruction is clear and unambiguous.
Finiteness: Algorithm terminates after a finite number of steps for all legitimate inputs.
Effectiveness: Every instruction must be basic enough to be carried out, in principle, by a person using only pencil and paper.
*These are the 5 characteristics that are needed to be remembered to define an "Algorithm"
Design Issues:
◇Correctness: Does it produce the correct output for all valid inputs? (Proving correctness often involves loop in variants, induction).
◇Efficiency: How well does it use resources (time, space)? (Handout 01, Page 2)
Simplicity/Readability: Is the algorithm easy to understand, implement, and maintain?
Optimal: Is this the best possible algorithm for the problem (often discussed in terms of lower bounds)?
Performance Metrics:
◇Time Complexity: How long does the algorithm take to run?
◇Space Complexity: How much memory does the algorithm require? (Handout 01, Page 2)

◇Complexity

OperationTimeSpace

◇Common Pitfalls

Confusing an algorithm with a program — an algorithm is a finite, abstract procedure; a program is its concrete implementation Ignoring the finiteness property — a procedure that may loop forever is not an algorithm Conflating correctness (produces the right output) with efficiency (does so quickly) — both are separate design concerns Assuming time complexity alone is sufficient — space complexity also matters, especially on memory-constrained systems Forgetting that input size definition varies by problem (e.g., number of elements vs. number of bits)

◇Summary

TL;DR — An algorithm is a finite, well-defined computational procedure with five properties: input, output, definiteness, finiteness, and effectiveness. Analyzing algorithms involves measuring correctness, time complexity, and space complexity relative to input size.

Related: - ◇Correctness - ◇Time Complexity - ◇Space Complexity Source / Reference:

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Which of the following is a characteristic of an algorithm?

Q2

What does the "Definiteness" characteristic of an algorithm mean?

Q3

Which property ensures that a procedure does not loop forever?

Q4

What is the difference between an algorithm and a program?

Q5

What does "Correctness" in algorithm design refer to?

Q6

Which characteristic requires that an instruction be basic enough to be executed by a person with pencil and paper?

Q7

What does Time Complexity measure?

Q8

Why is space complexity important, despite modern hardware advancements?

Q9

What is a common mistake when designing algorithms?

Q10

Which of the following metrics determines if the algorithm is easy to understand, implement, and maintain?

Algorithm | PROJECT ENGRAM