📖 Paper 1 – Unit 1: Algorithm Development and C Language Programming (MCA)

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:

  1. Boil water.

  2. Add tea leaves.

  3. Add sugar.

  4. Add milk.

  5. Stir and serve.

That’s an algorithm — but in cooking terms.


Properties of a Good Algorithm

  1. Definiteness → Every step must be clear and unambiguous.

  2. Finiteness → Must end after a finite number of steps.

  3. Input → Takes zero or more inputs.

  4. Output → Produces at least one output.

  5. 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:

  1. Start.

  2. Input A and B.

  3. If A > B, print A.

  4. Else, print B.

  5. Stop.


📍 Flowcharts

A flowchart is a graphical representation of an algorithm, using different shapes to represent different actions.


Common Flowchart Symbols

SymbolMeaning
OvalStart / End
RectangleProcess / Instruction
🔶 DiamondDecision (Yes/No)
ParallelogramInput / Output

Example Flowchart:
Algorithm: Find the largest of two numbers.

Start ↓ ⬠ Input A, B ↓ 🔶 Is A > B ? / \ Yes No | | ⬜ Print APrint 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.

Comments

Popular posts from this blog

Raster scan Vs Vector Scan

Inheritance

unit -1 Introduction of Image processing