📖 Paper 1 – Unit 1: Algorithm Development and C Language Programming (MCA)
- Get link
- X
- Other Apps
Part 1: Structure and Properties of an Algorithm
1. What is an Algorithm?
An algorithm is a step-by-step set of instructions to solve a specific problem.
Example:
If you want to make tea:
-
Boil water.
-
Add tea leaves.
-
Add sugar.
-
Add milk.
-
Stir and serve.
That’s an algorithm — but in cooking terms.
Properties of a Good Algorithm
-
Definiteness → Every step must be clear and unambiguous.
-
Finiteness → Must end after a finite number of steps.
-
Input → Takes zero or more inputs.
-
Output → Produces at least one output.
-
Effectiveness → Steps are basic enough to be done by hand or by computer.
Example in Computing:
Problem: Find the largest of two numbers A and B.
Algorithm:
-
Start.
-
Input A and B.
-
If A > B, print A.
-
Else, print B.
-
Stop.
📍 Flowcharts
A flowchart is a graphical representation of an algorithm, using different shapes to represent different actions.
Common Flowchart Symbols
Symbol | Meaning |
---|---|
⭕ Oval | Start / End |
⬜ Rectangle | Process / Instruction |
🔶 Diamond | Decision (Yes/No) |
⬠ Parallelogram | Input / Output |
Example Flowchart:
Algorithm: Find the largest of two numbers.
⭕ Start
↓
⬠ Input A, B
↓
🔶 Is A > B ?
/ \
Yes No
| |
⬜ Print A ⬜ Print B
| |
⭕ End
Why Flowcharts Matter:
-
Makes logic visual.
-
Easier to debug before coding.
-
Helps in team communication.
✅ Practice Task:
Draw a flowchart for finding the largest of three numbers (A, B, C).
Hint: You’ll need two decision diamonds.
- Get link
- X
- Other Apps
Comments
Post a Comment