Docsity

Introduction to Algorithms and Problem Solving in Python Programming, Study notes of Computer Science

Toggle sidebar
bg1
Chapter:๎˜‰Problem Solving and Python Programming : Algorithmic
Problem Solving
Algorithm
ALGORITHM
๎˜
It is defined as a sequence of instructions that describe a method for solving a
problem. In other words it is a step by step procedure for solving a problem.
๎˜
Properties of Algorithms
๏ถ๎˜๎˜๎˜Should be written in simple English
๏ถ๎˜๎˜๎˜Each and every instruction should be precise and unambiguous.
๏ถ๎˜๎˜๎˜Instructions in an algorithm should not be repeated infinitely.
๏ถ๎˜๎˜๎˜Algorithm should conclude after a finite number of steps.
๏ถ๎˜๎˜๎˜Should have an end point
๏ถ๎˜๎˜๎˜Derived results should be obtained only after the algorithm terminates.
!
Qualities of a good algorithm
The following are the primary factors that are often used to judge the quality
of the algorithms.
Time!โ€“!To execute a program, the computer system takes some amount of
time. The!lesser is the time required, the better is the algorithm.
Memory!โ€“!To execute a program, computer system takes some amount of
memory!space. The lesser is the memory required, the better is the algorithm.
pf2

Partial preview of the text

Download Introduction to Algorithms and Problem Solving in Python Programming and more Study notes Computer Science in PDF only on Docsity!

Chapter: Problem Solving and Python Programming : Algorithmic

Problem Solving

Algorithm

ALGORITHM

It is defined as a sequence of instructions that describe a method for solving a problem. In other words it is a step by step procedure for solving a problem. Properties of Algorithms ๏ถ Should be written in simple English ๏ถ Each and every instruction should be precise and unambiguous. ๏ถ Instructions in an algorithm should not be repeated infinitely. ๏ถ Algorithm should conclude after a finite number of steps. ๏ถ Should have an end point ๏ถ Derived results should be obtained only after the algorithm terminates. Qualities of a good algorithm The following are the primary factors that are often used to judge the quality of the algorithms. Time โ€“ To execute a program, the computer system takes some amount of time. The lesser is the time required, the better is the algorithm. Memory โ€“ To execute a program, computer system takes some amount of memory space. The lesser is the memory required, the better is the algorithm.

Accuracy โ€“ Multiple algorithms may provide suitable or correct solutions to a given problem, some of these may provide more accurate results than others, and such algorithms may be suitable. Example Write an algorithm to print โ€žGood Morningโ€ Step 1: Start Step 2: Print โ€œGood Morningโ€ Step 3: Stop