Skip to content

Language

Sign in

Learn › Class 9 › Mathematics › The World of Algorithms

Algorithms and flowcharts

Example 1: Euclid's algorithm for HCF(48, 18)

Open one step at a time. Try the next step yourself first.

  1. Step 1. Divide 48 by 18: remainder 12.
  2. Show step 2

    Divide 18 by 12: remainder 6.

  3. Show step 3

    Divide 12 by 6: remainder 0.

  4. Show step 4

    The last non-zero remainder is 6, so HCF = 6.

Example 2: Binary search for 37 in 5, 12, 20, 29, 37, 44, 51

Open one step at a time. Try the next step yourself first.

  1. Step 1. Middle value is 29. 37 is larger, so search the right half: 37, 44, 51.
  2. Show step 2

    Middle of that is 44. 37 is smaller, so search 37.

  3. Show step 3

    Found 37 after 3 comparisons.

Reviewed by EduFlint team on 1 Dec 2026 · version 1

Written by us for this site. Independent; not affiliated with NCERT or CBSE.

Report a mistake

Looking for another topic?