Module-2
Flowcharts & Algorithms
Flowcharts
Algorithms
Pseudocode
Time & Space Complexity.
1.
2.
3.
4.
Flowcharts
What are Flowcharts ?
Flowchart is a diagrammatic representation of sequence of
logical steps of a program.
Symbols
Flowcharts use simple geometric shapes and arrows for
processes and data flow.
Area of a Rectangle
input:
l,b
Output:
Area of Rectangle
My Approach for getting Idea
Input -> Process -> Output Strategy
Algorithms
Algorithms
Algorithm is a step-by-step procedure, which defines a set
of instructions to be executed in a certain order to get the
desired output.
step 1 − START
step 2 − declare three integers a, b,c
step 3 − define values of a & b
step 4 − sum calculation of a & b
step 5 − store output of step 4 to c
step 6 − print c
step 7 − STOP
Sum of 2 digits input:
a,b
Output:
Sum of a and b
Sum of 2 digits Explaination
input:
a,b
Output:
Sum of a and b
Pseudocode
Pseudocode
A way of expressing an algorithm without conforming
to specific syntax rules.
An informal high-level representation of the actual
code
set i to 0
for each i from 0 to 9
if i is odd
print i
end for loop
Example
Time & Space
Complexity
Time Complexity:
The time complexity of an algorithm quantifies the
amount of time taken by an algorithm to run as a function
of the length of the input.
Space Complexity:
Problem-solving using computer requires
memory to hold temporary data or final result
while the program is in execution. The amount
of memory required by the algorithm to solve
given problem
Module 2 Flowcharts & Algorithmswith.pdf

Module 2 Flowcharts & Algorithmswith.pdf

  • 1.
  • 2.
  • 3.
    What are Flowcharts? Flowchart is a diagrammatic representation of sequence of logical steps of a program.
  • 4.
    Symbols Flowcharts use simplegeometric shapes and arrows for processes and data flow.
  • 5.
    Area of aRectangle input: l,b Output: Area of Rectangle
  • 6.
    My Approach forgetting Idea Input -> Process -> Output Strategy
  • 7.
  • 8.
    Algorithms Algorithm is astep-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.
  • 9.
    step 1 −START step 2 − declare three integers a, b,c step 3 − define values of a & b step 4 − sum calculation of a & b step 5 − store output of step 4 to c step 6 − print c step 7 − STOP Sum of 2 digits input: a,b Output: Sum of a and b
  • 10.
    Sum of 2digits Explaination input: a,b Output: Sum of a and b
  • 11.
  • 12.
    Pseudocode A way ofexpressing an algorithm without conforming to specific syntax rules. An informal high-level representation of the actual code set i to 0 for each i from 0 to 9 if i is odd print i end for loop Example
  • 13.
  • 14.
    Time Complexity: The timecomplexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input. Space Complexity: Problem-solving using computer requires memory to hold temporary data or final result while the program is in execution. The amount of memory required by the algorithm to solve given problem