Overview of flowchart and algorithm, Lecture notes of Programming Methodologies

A flowchart is a visual representation of a process or algorithm. It uses various symbols to illustrate the steps involved, the flow of data, and the control flow. Flowcharts are widely used in computer science and engineering to design and represent processes in a clear and systematic way.

Typology: Lecture notes

2024/2025

Uploaded on 02/22/2025

felmar-mapute
felmar-mapute ๐Ÿ‡ญ๐Ÿ‡ฐ

2 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture Notes: Flowchart and Algorithm
I. Introduction to Flowchart
A flowchart is a visual representation of a process or algorithm. It uses various symbols to
illustrate the steps involved, the flow of data, and the control flow. Flowcharts are widely used in
computer science and engineering to design and represent processes in a clear and systematic
way.
Key Elements of a Flowchart:
1. Oval (Terminal)
โ—‹ Denotes the start or end of a process.
โ—‹ Example: Start, End.
2. Rectangle (Process)
โ—‹ Represents an action or process step.
โ—‹ Example: Input data, Calculate sum.
3. Parallelogram (Input/Output)
โ—‹ Used to represent input and output operations.
โ—‹ Example: Display result, Get user input.
4. Diamond (Decision)
โ—‹ Indicates a decision point with two possible branches: Yes or No.
โ—‹ Example: Is the number greater than 10?.
5. Arrow (Flowline)
โ—‹ Represents the direction of flow from one step to another.
Basic Flowchart Symbols:
Symbol
Purpose
Oval
Start or End
Rectangle
Process or Action
Parallelogra
m
Input or Output
pf3
pf4

Partial preview of the text

Download Overview of flowchart and algorithm and more Lecture notes Programming Methodologies in PDF only on Docsity!

Lecture Notes: Flowchart and Algorithm

I. Introduction to Flowchart

A flowchart is a visual representation of a process or algorithm. It uses various symbols to illustrate the steps involved, the flow of data, and the control flow. Flowcharts are widely used in computer science and engineering to design and represent processes in a clear and systematic way.

Key Elements of a Flowchart:

  1. Oval (Terminal)

โ—‹ Denotes the start or end of a process. โ—‹ Example: Start , End.

  1. Rectangle (Process)

โ—‹ Represents an action or process step. โ—‹ Example: Input data , Calculate sum.

  1. Parallelogram (Input/Output)

โ—‹ Used to represent input and output operations. โ—‹ Example: Display result , Get user input.

  1. Diamond (Decision)

โ—‹ Indicates a decision point with two possible branches: Yes or No. โ—‹ Example: Is the number greater than 10?.

  1. Arrow (Flowline)

โ—‹ Represents the direction of flow from one step to another.

Basic Flowchart Symbols:

Symbol Purpose

Oval Start or End

Rectangle Process or Action

Parallelogra m

Input or Output

Diamond Decision or Condition

Arrow Direction of Flow

Advantages of Flowcharts:

โ— Easy to understand and follow. โ— Provides a clear graphical representation of a process. โ— Helps identify problem areas or inefficiencies in a process. โ— Useful for debugging and improving code logic.

II. Introduction to Algorithm

An algorithm is a well-defined sequence of steps or instructions designed to perform a task or solve a problem. It is the foundation for writing computer programs and is often presented as pseudocode or flowcharts.

Characteristics of an Algorithm:

  1. Finiteness : An algorithm must terminate after a finite number of steps.
  2. Definiteness : Each step must be clearly defined and unambiguous.
  3. Input : An algorithm may take inputs (data) to operate on.
  4. Output : An algorithm produces output (result) based on the inputs.
  5. Effectiveness : Every step must be basic enough to be carried out effectively.

Types of Algorithms:

  1. Sorting Algorithms :

โ—‹ Organize data in a particular order (e.g., Bubble Sort, Quick Sort).

  1. Search Algorithms :

โ—‹ Find a specific element in a collection of data (e.g., Binary Search, Linear Search).

  1. Greedy Algorithms :

โ—‹ Make optimal choices at each step with the hope of finding a global optimum (e.g., Knapsack Problem).

  1. Divide and Conquer Algorithms :

โ—‹ Break down a problem into smaller subproblems (e.g., Merge Sort, Quick Sort).

  1. Start (Oval)
  2. Input three numbers (Parallelogram)
  3. Decision (Diamond): Is A > B and A > C? โ—‹ Yes: Print A (Rectangle) โ—‹ No: Next Decision (Diamond): Is B > A and B > C? โ–  Yes: Print B (Rectangle) โ–  No: Print C (Rectangle)
  4. End (Oval)

V. Conclusion

Both flowcharts and algorithms are essential tools for problem-solving and programming. While flowcharts provide a visual representation, algorithms provide a more detailed, logical approach to problem-solving. Understanding both is key to designing efficient systems and solving computational problems effectively.