Comprehensive Study Guide: Algorithms and Flowcharts
Course Overview and Academic Context
Course: BSc - IT, Semester-1
Chapter: Chapter-1: Algorithms & Flowcharts
Instructor: Dr. Sivakumar, Professor / IT
Institution: BlueCrest University, Liberia
Fundamentals of Algorithms
Definition: An algorithm is defined as a finite set of clear, unambiguous, and ordered steps designed to solve a specific problem.
Core Functions:
Specifies WHAT actions must be performed.
Dictates IN WHAT ORDER those actions must be executed.
Representations:
Algorithms can be expressed in simple English prose, pseudocode, or other structured formatting styles.
Programming languages serve to translate these algorithmic solutions into directly executable machine/computer code.
Characteristics of a Good Algorithm:
Input: Accepts zero or more clearly defined input values.
Output: Produces at least one output result.
Definiteness: Every individual step must be clear, precise, and unambiguous in meaning.
Finiteness: The algorithm must terminate after executing a finite number of steps.
Effectiveness: Every step must be basic enough to be feasibly executed in practice.
Correctness: Consistently yields the correct and intended output for valid inputs.
Example: Add Two Numbers
Problem Statement: Read two numbers and display their sum.
Algorithm Steps:
Start
Read and
Calculate
Display
Stop
Fundamentals of Flowcharts
Definition: A flowchart is a visual or graphical representation of an algorithm.
Core Characteristics and Benefits:
Utilizes standardized geometric symbols interconnected by directional flow arrows.
Simplifies the visual comprehension, analysis, and discussion of program logic.
Serves as a fundamental tool for program planning, instruction, debugging, and comprehensive documentation.
Basic Diagrammatic Connection:
Illustrates sequential control handoff between phases, such as moving from a terminal Start state to an Input block.

Standard Flowchart Symbols:
Oval: Represents Terminal points (Start / End / Stop).
Rectangle: Represents Process / Calculation operations.
Parallelogram: Represents Input / Output operations.
Diamond: Represents Decision nodes (evaluating conditional branches).
Arrows / Lines: Indicate the direction of execution flow.
Basic Program Control Structures
Overview: Complex software systems and algorithms are synthesized by combining three primary structural patterns:
Sequence: Instructions are executed sequentially, one after another.
Selection: Decision criteria branch execution into alternative paths.
Iteration (Repetition): A specific sequence of steps is repeatedly executed as long as a condition is satisfied.
Sequence Control Structure
Definition: Execution flows linearly in a continuous line from start to finish without conditional branches or repeating loops.
Sequence Example 1: Add Two Numbers and Print Sum
Logic Flow:
Start
Input numbers:
Calculate
Display
Stop

Sequence Example 2: Find Percentage of Five Subject Marks
Logic Flow:
Start (
START)Input subject marks:
Calculate total marks:
Calculate percentage:
Display output: &
Stop (
STOP)
Selection Control Structure
Definition: Implements choice and conditional logic (such as IF-ELSE structures) where decision nodes direct the flow down distinct operational branches.
Selection Example: Determine if Given Number is Positive or Negative
Logic Flow:
Start (
START)Input value
Decision node: Check if
Yes Path: Execute process
PositiveNo Path: Execute process
Negative
End state (
END)
Iteration Control Structure
Definition: Continuously repeats a block of instructions while a controlling boolean condition remains true.
Common Code Implementations:
FORloops,WHILEloops, andDO-WHILEloops.Iteration Example 1: Print Numbers from 1 to 10
Textual Algorithm Steps:
Step 1: Start
Step 2: Initialize loop variable to
Step 3: Repeat while
a. Print the value of
b. Increment by (
Step 4: End
Flowchart Logic:
Start (
Start)Process node: Initialize counter variable
Decision node: Evaluate
is?Yes Path:
Output node:
PrintProcess node: Increment
Loop back to decision node
isNo Path:
Terminal node:
Stop
Iteration Example 2: Print Sum of Numbers from 1 to
Flowchart Logic:
Start (
START)Input node:
READInitialization process node: ,
Loop processes:
Decision node: Evaluate
IS?NO Path: Re-entry loop back to
YES Path: Proceed to output
Output node:
OUTPUTTerminal node:
STOPW
Comparative Analysis: Algorithm vs. Flowchart
Algorithm:
Formatted as plain text.
Quick and simple to write initially.
Expressed through written statements and numbered steps.
Ideal for describing fine-grained, detailed logic.
Flowchart:
Formatted graphically.
Highly effective for visual logic tracking.
Expressed through standard geometric symbols and connecting lines.
Ideal for gaining a comprehensive overview of program architecture and control flow.
Worked Examples
Worked Example 1: Adding Three Numbers
Logic Steps:
STARTInput node:
READProcess node:
Output node:
OUTPUTSTOP
Worked Example 2: Find the Larger of Two Numbers
Logic Steps:
STARTInput node:
READDecision node: Evaluate
IS?YES Branch: Output node
OUTPUTSTOPNO Branch: Output node
OUTPUTSTOP
Classroom Practice and Application Problems
Problem 1: Write an algorithm to calculate the area of a rectangle.
Problem 2: Draw a flowchart to check whether a given number is positive, negative, or zero.
Problem 3: Write an algorithm to find the average of three numbers.
Problem 4: Draw a flowchart to display numbers in descending order from down to
Challenge Problem: Construct an algorithm and corresponding flowchart to find the largest among three numbers.