ALGORITHM
NAME : MD AKRAM
ROLL NO. : 16500221002
REG NO. : 211650100210012
SUBJECT : DATA STRUCTURE & ALGORITHMS
SUBJECT CODE : PCC-CS301
WHAT IS AN ALGORITHM ?
• AN ALGORITHM IS A PROCEDURE USED FOR SOLVING A PROBLEM OR PERFORMING
A COMPUTATION.
• ALGORITHMS ACT AS AN EXACT LIST OF INSTRUCTIONS THAT CONDUCT SPECIFIED
ACTIONS STEP BY STEP IN EITHER HARDWARE - OR SOFTWARE-BASED ROUTINES.
• ALGORITHMS ARE ALSO USED AS SPECIFICATIONS FOR PERFORMING DATA
PROCESSING AND PLAY A MAJOR ROLE IN AUTOMATED SYSTEMS.
• AN ALGORITHM COULD BE USED FOR SORTING SETS OF NUMBERS OR FOR
MORE COMPLICATED TASKS. ALGORITHMS TYPICALLY START WITH INITIAL
INPUT AND INSTRUCTIONS THAT DESCRIBE A SPECIFIC COMPUTATION. WHEN
THE COMPUTATION IS EXECUTED, THE PROCESS PRODUCES AN OUTPUT.
PROPERTIES OF
ALGORITHM
→IT SHOULD TERMINATE AFTER A FINITE TIME.
→IT SHOULD PRODUCE AT LEAST ONE OUTPUT.
→IT SHOULD TAKE ZERO OR MORE INPUT.
→IT SHOULD BE DETERMINISTIC MEANS GIVING THE SAME OUTPUT
FOR THE SAME INPUT CASE.
→EVERY STEP IN THE ALGORITHM MUST BE EFFECTIVE I.E. EVERY
STEP SHOULD DO SOME WORK.
 The term algorithm derives from the
name of Muhammad ibn Mūsā
al'Khwārizmī, a ninth-century
Persian mathematician.
 His latinized name, Algoritmi, meant
“the decimal number system” and
was used in this meaning for
centuries.
ADVANTAGES OF
ALGORITHMS
It is easy to understand.
An algorithm is a step-wise representation of a
solution to a given problem.
In Algorithm the problem is broken down into smaller
pieces or steps hence, it is easier for the programmer
to convert it into an actual program.
DISADVANTAGES OF
ALGORITHMS
Writing an algorithm takes a lot of time so it is time
consuming.
Understanding complex logic through algorithm can
be very difficult.
Branching and looping statements are difficult to
show in algorithms.
Step 1: Start.
Step 2: Read a number to N.
Step 3: Divide the number by 2 and store the
remainder in R.
Step 4: If R = OThen go to Step 6.
Step 5: Print “N is odd” go to step 7.
Step 6: Print “N is even”
Step 7: Stop.
Example :
Most important type of Algorithms:
Brute ForceAlgorithm:
This is the most basic and simplest type of algorithm. A Brute Force Algorithm is the straightforward approach to a problem i.e., the first approach that comes to our
mind on seeing the problem. More technically it is just like iterating every possibility available to solve that problem
For Example: If there is a lock of 4-digit PIN.The digits to be chosen from 0-9 then the brute force will be trying all possible combinations one by one like 0001, 0002,
0003, 0004, and so on until we get the right PIN. In the worst case, it will take 10,000 tries to find the right combination
RandomizedAlgorithm :
In the randomized algorithm, we use a random number.it helps to decide the expected outcome.The decision to choose the random number so it gives the
immediate benefits
HashingAlgorithm
Hashing algorithms work the same as the Searching algorithm but they contain an index with a key ID. In hashing, we assign a key to specific data.
Example: Some common problems that can be solved through the Hashing Algorithm in password verification.
The searching algorithm is the algorithm that is used for searching the specific key in particular sorted or unsorted data. Some common problems that can be solved
through the Searching Algorithm are Binary search or linear search is one example of a Searching algorithm
The sorting algorithm is used to sort data in maybe ascending or descending order. Its also used for arranging data in an efficient and useful manner.
THANK YOU
!!

ALGORITHM.pptx

  • 1.
    ALGORITHM NAME : MDAKRAM ROLL NO. : 16500221002 REG NO. : 211650100210012 SUBJECT : DATA STRUCTURE & ALGORITHMS SUBJECT CODE : PCC-CS301
  • 2.
    WHAT IS ANALGORITHM ? • AN ALGORITHM IS A PROCEDURE USED FOR SOLVING A PROBLEM OR PERFORMING A COMPUTATION. • ALGORITHMS ACT AS AN EXACT LIST OF INSTRUCTIONS THAT CONDUCT SPECIFIED ACTIONS STEP BY STEP IN EITHER HARDWARE - OR SOFTWARE-BASED ROUTINES. • ALGORITHMS ARE ALSO USED AS SPECIFICATIONS FOR PERFORMING DATA PROCESSING AND PLAY A MAJOR ROLE IN AUTOMATED SYSTEMS. • AN ALGORITHM COULD BE USED FOR SORTING SETS OF NUMBERS OR FOR MORE COMPLICATED TASKS. ALGORITHMS TYPICALLY START WITH INITIAL INPUT AND INSTRUCTIONS THAT DESCRIBE A SPECIFIC COMPUTATION. WHEN THE COMPUTATION IS EXECUTED, THE PROCESS PRODUCES AN OUTPUT.
  • 3.
    PROPERTIES OF ALGORITHM →IT SHOULDTERMINATE AFTER A FINITE TIME. →IT SHOULD PRODUCE AT LEAST ONE OUTPUT. →IT SHOULD TAKE ZERO OR MORE INPUT. →IT SHOULD BE DETERMINISTIC MEANS GIVING THE SAME OUTPUT FOR THE SAME INPUT CASE. →EVERY STEP IN THE ALGORITHM MUST BE EFFECTIVE I.E. EVERY STEP SHOULD DO SOME WORK.
  • 4.
     The termalgorithm derives from the name of Muhammad ibn Mūsā al'Khwārizmī, a ninth-century Persian mathematician.  His latinized name, Algoritmi, meant “the decimal number system” and was used in this meaning for centuries.
  • 5.
    ADVANTAGES OF ALGORITHMS It iseasy to understand. An algorithm is a step-wise representation of a solution to a given problem. In Algorithm the problem is broken down into smaller pieces or steps hence, it is easier for the programmer to convert it into an actual program.
  • 6.
    DISADVANTAGES OF ALGORITHMS Writing analgorithm takes a lot of time so it is time consuming. Understanding complex logic through algorithm can be very difficult. Branching and looping statements are difficult to show in algorithms.
  • 7.
    Step 1: Start. Step2: Read a number to N. Step 3: Divide the number by 2 and store the remainder in R. Step 4: If R = OThen go to Step 6. Step 5: Print “N is odd” go to step 7. Step 6: Print “N is even” Step 7: Stop. Example :
  • 8.
    Most important typeof Algorithms: Brute ForceAlgorithm: This is the most basic and simplest type of algorithm. A Brute Force Algorithm is the straightforward approach to a problem i.e., the first approach that comes to our mind on seeing the problem. More technically it is just like iterating every possibility available to solve that problem For Example: If there is a lock of 4-digit PIN.The digits to be chosen from 0-9 then the brute force will be trying all possible combinations one by one like 0001, 0002, 0003, 0004, and so on until we get the right PIN. In the worst case, it will take 10,000 tries to find the right combination RandomizedAlgorithm : In the randomized algorithm, we use a random number.it helps to decide the expected outcome.The decision to choose the random number so it gives the immediate benefits HashingAlgorithm Hashing algorithms work the same as the Searching algorithm but they contain an index with a key ID. In hashing, we assign a key to specific data. Example: Some common problems that can be solved through the Hashing Algorithm in password verification. The searching algorithm is the algorithm that is used for searching the specific key in particular sorted or unsorted data. Some common problems that can be solved through the Searching Algorithm are Binary search or linear search is one example of a Searching algorithm The sorting algorithm is used to sort data in maybe ascending or descending order. Its also used for arranging data in an efficient and useful manner.
  • 9.