SlideShare a Scribd company logo
UNIT - 1
Introduction: The Role of Algorithms in Computing, Algorithms
as a technology, Analyzing algorithms, Designing algorithms,
Growth of Functions, Asymptotic notation, Standard notations
and common functions.
Fundamental Algorithms: Exchanging the values of two
variables, Counting, Summation of a set of numbers, Factorial
Computation, Generating of the Fibonacci sequence, Reversing
the digits of an integer, Character to number conversion.
Problem solving
•It is a systematic approach to find and implement the solution to a
problem.
Program
•It is a set of instructions written in computer languages
Software
•It is a collection of computer program (or) data and instructions.
•It is responsible for controlling, integration and managing hardware
components and perform specific tasks.
Classifications of software
System software
•It is a set of one or more programs that manage and support
a computer system hardware and its data processing
activities.
•Ex: Operating system, Compilers, Assemblers
Application software
•It is a set of one or more programs, designed to solve a
specific problem or a specific task.
•Ex: Ms-Word ,Ms-Excel, Ms-Powerpoint
Steps in Problem Solving
1. Problem Definition
2. Problem Analysis
3. Design
4. Coding
5. Testing
6. Maintenance
1. Problem Definition
•To solve a problem, the first step is to
identify and define the problem.
•The problem must be stated clearly,
accurately and precisely.
•Ex: Find largest of three numbers
2. Problem Analysis
The problem analysis helps in designing and coding for that
particular problem.
1. Input specifications
•The number of inputs and what forms the input are available
2.Output specifications
•The number of outputs and what forms the output should be
displayed.
Ex:
•input – a,b,c
•output – a (or) b (or) c
3. Designing a program
Algorithms
•Algorithm - step by step procedure of solving a problem
Flowcharts
•Flowcharts – It is the graphical representation of the
algorithm.
4. Coding
• Writing instructions in a particular language to solve a
problem.
5. Testing a Program
• After writing a program, programmer needs to test the
program for completeness, correctness, reliability and
maintainability.
• Unit testing
• Program Testing
• Verification Testing
• Validation Testing
6. Maintaining the program
•It means periodic review of the
programs and modifications based on
user requirements.
What is an Algorithm?
•In computer programming terms, an algorithm is a set of
well-defined instructions to solve a particular problem. It
takes a set of input(s) and produces the desired output.
For example,
•An algorithm to add two numbers:
1. Take two number inputs
2. Add numbers using the + operator
3. Store the result
4. Display the result
Hint:
Need of the Algorithm:
Algorithms are used to solve problems or automate tasks in a systematic and efficient manner. They are a set of
instructions or rules that guide the computer or software in performing a particular task or solving a problem.
Qualities of a Good Algorithm
•Input and output should be defined
precisely.
•Each step in the algorithm should be clear
and unambiguous.
•Algorithms should be most effective among
many different ways to solve a problem.
•An algorithm shouldn't include computer
code. Instead, the algorithm should be
written in such a way that it can be used in
different programming languages.
Characteristics of an algorithm
The characteristics of an algorithm are
•(i) Algorithm must have finite number of steps.
•(ii) No instructions should be repeated.
•(iii) An algorithm should be simple.
•(iii) An algorithm must take atleast one or more
input values.
•(iv) An algorithm must provide atleast one or more
output values.
Characteristics of an algorithm
Advantages
•Algorithms are very easy to
understand.
•Algorithm is programming language
independent.
•Algorithm makes the problem simple,
clear, correct.
The Role of Algorithms
• Algorithms play a crucial role in computing by providing
a set of instructions for a computer to perform a specific
task.
• They are used to solve problems and carry out tasks in
computer systems, such as sorting data, searching for
information, image processing, and much more.
• An algorithm defines the steps necessary to produce
the desired outcome, and the computer follows the
instructions to complete the task efficiently and
accurately.
Role of Algorithm in Applications
Role of Algorithm in Computing
Role of Algorithm in Networking
Algorithm to Add two numbers entered by
the user
• Step 1: Start
• Step 2: Declare variables num1, num2 and sum.
• Step 3: Read values num1 and num2.
• Step 4: Add num1 and num2 and assign the result to sum.
• sum←num1+num2
• Step 5: Display sum
• Step 6: Stop
Algorithm for Swapping
two numbers using third
variable:
Step 1: Declare a variable a,b
and c as integer;
Step 2: Read two numbers a and
b;
Step 3: c=a;
Step 4: a=b;
Step 5: b=c;
Step 6: Print a and b
STEP 1: START
STEP 2: ENTER A, B
STEP 3: PRINT A, B
STEP 4: A = A + B
STEP 5: B= A - B
STEP 6: A =A - B
STEP 7: PRINT A, B
STEP 8: END
Algorithm for Swapping two
numbers without using third
variable:
Algorithm to find Summation of a set of
numbers
Step 1: Start
Step 2: Read the number n
Step 3: Calculate the sum of n natural number, sum = n * (n + 1) / 2
Step 4: Display sum
Step 5: End
Algorithm to find count of numbers of digits
in a number
• Step 1: Declare variable a and n; //n variable is used for counting
• Step 2: Read number a;
• Step 3: while(a not equal 0)
• a=a/10;
• n=n+1;
• end
• Step 4: Print n;
• Step 5: End
Algorithm to Find the largest number among
three numbers
Step 1: Start
Step 2: Declare variables a,b and c.
Step 3: Read variables a,b and c.
Step 4: If a > b
If a > c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b > c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5: Stop
Algorithm to Find the factorial of a number
Step 1: Start
Step 2: Declare variables n, fact and i.
Step 3: Initialize variables
fact← 1
i ← 1
Step 4: Read value of n
Step 5: Repeat the steps until i = n
5.1: fact ← fact*i
5.2: i ← i+1
Step 6: Display fact
Step 7: Stop
Algorithm 6: Find the Fibonacci series
• Step 1: Start
• Step 2: Declare variable a, b, c, n, i
• Step 3: Initialize variable a=0, b=1 and i=2
• Step 4: Read n from user
• Step 5: Print a and b
• Step 6: Repeat until i<=n :
Step 6.1: c=a+b
Step 6.2: print c
Step 6.3: a=b, b=c
Step 6.4: i=i+1
• Step 7: Stop
Algorithm to Reversing the digits of an
integer
• Step 1: Declare variable n, rev and rem as integer;
• Step 2: Read the number n;
• Step 3: while n not equal 0
{
rem=n%10;
rev=rev * 10 + rem;
n=n/10;
}
• Step 4: Print rev
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
GREATEST OF THREE
NUMBERS
FACTORIAL OF GIVEN
NUMBER
FIBONACCI SERIES
REVERSE THE GIVEN
NUMBER
Problem Solving Techniques notes for Unit 1
Algorithms as a technology
Analysing Algorithms
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Problem Solving Techniques notes for Unit 1
Designing algorithms

More Related Content

PPTX
Process synchronization in Operating Systems
PDF
Black Box Testing
PPTX
Algorithms and flowcharts
PPTX
What is a Computer?
PPTX
Constant, variables, data types
PPTX
Computer software
PPT
Basic ops concept of comp
PPTX
Software testing
Process synchronization in Operating Systems
Black Box Testing
Algorithms and flowcharts
What is a Computer?
Constant, variables, data types
Computer software
Basic ops concept of comp
Software testing

What's hot (20)

PPT
Black box & white-box testing technique
PPT
Keyboarding skills
PPTX
Peter Norton - Introduction to computers - Part 2
PPTX
Software Configuration Management
PPTX
Introduction to computer
PPTX
Language design and translation issues
PPT
Peter Norton’s Introduction to Computers
PPT
Chapter 1B Peter Norton
PPTX
Operating system 23 process synchronization
PPS
Formal Methods
PPT
OPERATING SYSTEM
PPTX
Types of Programming Errors
PPT
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
PPTX
bus and memory tranfer (computer organaization)
PPTX
Computer Keyboard
PPT
2.3 Apply the different types of algorithm to solve problem
PPTX
Chapter 2.1 introduction to number system
DOCX
Operating System Process Synchronization
PDF
Unit 4-input-output organization
Black box & white-box testing technique
Keyboarding skills
Peter Norton - Introduction to computers - Part 2
Software Configuration Management
Introduction to computer
Language design and translation issues
Peter Norton’s Introduction to Computers
Chapter 1B Peter Norton
Operating system 23 process synchronization
Formal Methods
OPERATING SYSTEM
Types of Programming Errors
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
bus and memory tranfer (computer organaization)
Computer Keyboard
2.3 Apply the different types of algorithm to solve problem
Chapter 2.1 introduction to number system
Operating System Process Synchronization
Unit 4-input-output organization
Ad

Similar to Problem Solving Techniques notes for Unit 1 (20)

PPTX
Design and Analysis of Algorithm ppt for unit one
PPT
AOA Week 01.ppt
PDF
Algorithms notes 2 tutorials duniya
PPTX
Algorithm in data structure bca .pptx
PDF
Lecture 2 role of algorithms in computing
PPT
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
PPT
UNIT 1- Design Analysis of algorithms and its working
PPT
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
PDF
Algorithm Analysis.pdf
PPTX
Chp-1 DAA (2).pptx design analysis and algoritham presentation
PPTX
What is algorithm
PDF
Chapter-1-Introduction-to-Aglorithms.pdf
PPT
UNIT-1-PPTS-DAA.ppt
PPT
UNIT-1-PPTS-DAA.ppt
PPT
Introduction to Design Algorithm And Analysis.ppt
PPTX
Binary to hexadecimal algorithmic old.pptx
PPTX
Algorithm and flowchart with pseudo code
PPT
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
PPTX
UNIT-1.pptx python for engineering first year students
PPSX
Ds03 part i algorithms by jyoti lakhani
Design and Analysis of Algorithm ppt for unit one
AOA Week 01.ppt
Algorithms notes 2 tutorials duniya
Algorithm in data structure bca .pptx
Lecture 2 role of algorithms in computing
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
UNIT 1- Design Analysis of algorithms and its working
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
Algorithm Analysis.pdf
Chp-1 DAA (2).pptx design analysis and algoritham presentation
What is algorithm
Chapter-1-Introduction-to-Aglorithms.pdf
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
Introduction to Design Algorithm And Analysis.ppt
Binary to hexadecimal algorithmic old.pptx
Algorithm and flowchart with pseudo code
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
UNIT-1.pptx python for engineering first year students
Ds03 part i algorithms by jyoti lakhani
Ad

More from SATHYABAMAMADHANKUMA (20)

PDF
Functional Dependencies and Normalization for Relational Databases
PDF
Functional Dependencies and Normalization for Relational Databases
PDF
SPM MODULE - 1 - PPT - MCA VTU SPM NOTES UNIT 1
PPTX
SOFTSKILLS and its types and the explanation
PPTX
introduction about software engineering for mca srudents
PPTX
WEB PRORAMMING NOTES WITH EXAMPLE PROGRAMS
PPTX
DOC-20241022-WA0000[1] - Read-Only.pptx
PDF
Blooms_Taxonomy. Revised for setting question papers for all kind of exams
PPT
1. Introduction to OS.ppt
PPTX
Client Side Scripting.pptx
PPT
2. Relational Algebra.ppt
PPT
1. UNIT - III.ppt
PPT
OK_Unit - I Multidisciplinary nature of environmental studies.ppt
PPT
Unit - II - Eco Systems.ppt
PPT
Unit - III Natural Resources.ppt
PPT
WP - Unit I.ppt
PPT
5-Recovery.ppt
PPTX
6.RISK MANAGEMENT.pptx
PPT
DBMS-CPD.ppt
PDF
system prgramming - loaders-linkers.pdf
Functional Dependencies and Normalization for Relational Databases
Functional Dependencies and Normalization for Relational Databases
SPM MODULE - 1 - PPT - MCA VTU SPM NOTES UNIT 1
SOFTSKILLS and its types and the explanation
introduction about software engineering for mca srudents
WEB PRORAMMING NOTES WITH EXAMPLE PROGRAMS
DOC-20241022-WA0000[1] - Read-Only.pptx
Blooms_Taxonomy. Revised for setting question papers for all kind of exams
1. Introduction to OS.ppt
Client Side Scripting.pptx
2. Relational Algebra.ppt
1. UNIT - III.ppt
OK_Unit - I Multidisciplinary nature of environmental studies.ppt
Unit - II - Eco Systems.ppt
Unit - III Natural Resources.ppt
WP - Unit I.ppt
5-Recovery.ppt
6.RISK MANAGEMENT.pptx
DBMS-CPD.ppt
system prgramming - loaders-linkers.pdf

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Types and Its function , kingdom of life
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
01-Introduction-to-Information-Management.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Lesson notes of climatology university.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Supply Chain Operations Speaking Notes -ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Sports Quiz easy sports quiz sports quiz
Microbial disease of the cardiovascular and lymphatic systems
O7-L3 Supply Chain Operations - ICLT Program
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Types and Its function , kingdom of life
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Complications of Minimal Access Surgery at WLH
01-Introduction-to-Information-Management.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Lesson notes of climatology university.

Problem Solving Techniques notes for Unit 1

  • 1. UNIT - 1 Introduction: The Role of Algorithms in Computing, Algorithms as a technology, Analyzing algorithms, Designing algorithms, Growth of Functions, Asymptotic notation, Standard notations and common functions. Fundamental Algorithms: Exchanging the values of two variables, Counting, Summation of a set of numbers, Factorial Computation, Generating of the Fibonacci sequence, Reversing the digits of an integer, Character to number conversion.
  • 2. Problem solving •It is a systematic approach to find and implement the solution to a problem. Program •It is a set of instructions written in computer languages Software •It is a collection of computer program (or) data and instructions. •It is responsible for controlling, integration and managing hardware components and perform specific tasks.
  • 3. Classifications of software System software •It is a set of one or more programs that manage and support a computer system hardware and its data processing activities. •Ex: Operating system, Compilers, Assemblers Application software •It is a set of one or more programs, designed to solve a specific problem or a specific task. •Ex: Ms-Word ,Ms-Excel, Ms-Powerpoint
  • 4. Steps in Problem Solving 1. Problem Definition 2. Problem Analysis 3. Design 4. Coding 5. Testing 6. Maintenance
  • 5. 1. Problem Definition •To solve a problem, the first step is to identify and define the problem. •The problem must be stated clearly, accurately and precisely. •Ex: Find largest of three numbers
  • 6. 2. Problem Analysis The problem analysis helps in designing and coding for that particular problem. 1. Input specifications •The number of inputs and what forms the input are available 2.Output specifications •The number of outputs and what forms the output should be displayed. Ex: •input – a,b,c •output – a (or) b (or) c
  • 7. 3. Designing a program Algorithms •Algorithm - step by step procedure of solving a problem Flowcharts •Flowcharts – It is the graphical representation of the algorithm.
  • 8. 4. Coding • Writing instructions in a particular language to solve a problem. 5. Testing a Program • After writing a program, programmer needs to test the program for completeness, correctness, reliability and maintainability. • Unit testing • Program Testing • Verification Testing • Validation Testing
  • 9. 6. Maintaining the program •It means periodic review of the programs and modifications based on user requirements.
  • 10. What is an Algorithm? •In computer programming terms, an algorithm is a set of well-defined instructions to solve a particular problem. It takes a set of input(s) and produces the desired output. For example, •An algorithm to add two numbers: 1. Take two number inputs 2. Add numbers using the + operator 3. Store the result 4. Display the result Hint: Need of the Algorithm: Algorithms are used to solve problems or automate tasks in a systematic and efficient manner. They are a set of instructions or rules that guide the computer or software in performing a particular task or solving a problem.
  • 11. Qualities of a Good Algorithm •Input and output should be defined precisely. •Each step in the algorithm should be clear and unambiguous. •Algorithms should be most effective among many different ways to solve a problem. •An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.
  • 12. Characteristics of an algorithm The characteristics of an algorithm are •(i) Algorithm must have finite number of steps. •(ii) No instructions should be repeated. •(iii) An algorithm should be simple. •(iii) An algorithm must take atleast one or more input values. •(iv) An algorithm must provide atleast one or more output values.
  • 14. Advantages •Algorithms are very easy to understand. •Algorithm is programming language independent. •Algorithm makes the problem simple, clear, correct.
  • 15. The Role of Algorithms • Algorithms play a crucial role in computing by providing a set of instructions for a computer to perform a specific task. • They are used to solve problems and carry out tasks in computer systems, such as sorting data, searching for information, image processing, and much more. • An algorithm defines the steps necessary to produce the desired outcome, and the computer follows the instructions to complete the task efficiently and accurately.
  • 16. Role of Algorithm in Applications
  • 17. Role of Algorithm in Computing
  • 18. Role of Algorithm in Networking
  • 19. Algorithm to Add two numbers entered by the user • Step 1: Start • Step 2: Declare variables num1, num2 and sum. • Step 3: Read values num1 and num2. • Step 4: Add num1 and num2 and assign the result to sum. • sum←num1+num2 • Step 5: Display sum • Step 6: Stop
  • 20. Algorithm for Swapping two numbers using third variable: Step 1: Declare a variable a,b and c as integer; Step 2: Read two numbers a and b; Step 3: c=a; Step 4: a=b; Step 5: b=c; Step 6: Print a and b STEP 1: START STEP 2: ENTER A, B STEP 3: PRINT A, B STEP 4: A = A + B STEP 5: B= A - B STEP 6: A =A - B STEP 7: PRINT A, B STEP 8: END Algorithm for Swapping two numbers without using third variable:
  • 21. Algorithm to find Summation of a set of numbers Step 1: Start Step 2: Read the number n Step 3: Calculate the sum of n natural number, sum = n * (n + 1) / 2 Step 4: Display sum Step 5: End
  • 22. Algorithm to find count of numbers of digits in a number • Step 1: Declare variable a and n; //n variable is used for counting • Step 2: Read number a; • Step 3: while(a not equal 0) • a=a/10; • n=n+1; • end • Step 4: Print n; • Step 5: End
  • 23. Algorithm to Find the largest number among three numbers Step 1: Start Step 2: Declare variables a,b and c. Step 3: Read variables a,b and c. Step 4: If a > b If a > c Display a is the largest number. Else Display c is the largest number. Else If b > c Display b is the largest number. Else Display c is the greatest number. Step 5: Stop
  • 24. Algorithm to Find the factorial of a number Step 1: Start Step 2: Declare variables n, fact and i. Step 3: Initialize variables fact← 1 i ← 1 Step 4: Read value of n Step 5: Repeat the steps until i = n 5.1: fact ← fact*i 5.2: i ← i+1 Step 6: Display fact Step 7: Stop
  • 25. Algorithm 6: Find the Fibonacci series • Step 1: Start • Step 2: Declare variable a, b, c, n, i • Step 3: Initialize variable a=0, b=1 and i=2 • Step 4: Read n from user • Step 5: Print a and b • Step 6: Repeat until i<=n : Step 6.1: c=a+b Step 6.2: print c Step 6.3: a=b, b=c Step 6.4: i=i+1 • Step 7: Stop
  • 26. Algorithm to Reversing the digits of an integer • Step 1: Declare variable n, rev and rem as integer; • Step 2: Read the number n; • Step 3: while n not equal 0 { rem=n%10; rev=rev * 10 + rem; n=n/10; } • Step 4: Print rev
  • 38. Algorithms as a technology