Introduction to Algorithm Session 1 Course: T0974-Algorithm & Object-Oriented Programming I Year: 2011.

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering
UNIT 2. Introduction to Computer Programming
ME 142 Engineering Computation I Fundamentals of Procedural Computer Programming.
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Chapter 1 Pseudocode & Flowcharts
INTRODUCTION TO PROGRAMMING
Algorithm –History Muhammad ibn Musa Al-Khwarizmi www -groups.dcs.st-andrews.ac.uk/~history/Mathematicians/Al- Khwarizmi.html Book on arithmetic:
Chapter 2- Visual Basic Schneider
Developing logic (Examples on algorithm and flowchart)
Algorithms and flow charts
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
ALGORITHMS AND FLOWCHARTS
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
CIS Computer Programming Logic
C++ If….Else Statements and Flowcharts October 10, 2007.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Input, Output, and Processing
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Software Life Cycle What Requirements Gathering, Problem definition
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Flowcharts.
Design & Analysis of Algorithms Lecture 1 Introduction.
ALGORITHM List of instructions for carrying out some process step by step. A sequence of instructions which has a clear meaning and can performed with.
Algorithms & Flowchart
Chapter 2: General Problem Solving Concepts
Lecture 11: 10/1/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Chapter 1 Pseudocode & Flowcharts
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Algorithms Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin,
Visual Basic Flowcharts October 10, Turn in your vocabulary words before you leave!
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
Programming. In your own words, explain what an algorithm is, and give an example of how people use algorithms every day.
1 Introduction to Turing Machines
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
1.  A step by step process to solve any problem is called algorithm.  Algorithm is a process which take some values as input and provide us output.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
 Problem Analysis  Coding  Debugging  Testing.
Algorithms and Flowcharts
Pseudocode (pronounced SOO-doh-kohd)  is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled.
Topic: Introduction to Computing Science and Programming + Algorithm
GC101 Introduction to computers and programs
INTRODUCTION TO PROBLEM SOLVING
Unit 3: ALGORITHMS AND FLOWCHARTS
Problem , Problem Solving, Algorithm & Flow Charts –Part 1
Topic: Introduction to Computing Science and Programming + Algorithm
CSCI-235 Micro-Computer Applications
Computer Programming.
Algorithm & Programming
Chapter 2- Visual Basic Schneider
3.1 Algorithms (and real programming examples).
Introduction To Flowcharting
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
Introduction to Computer Programming
Programming Fundamentals
ALGORITHMS AND FLOWCHARTS
Program Control using Java - Theory
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
Lecture 6 Architecture Algorithm Defin ition. Algorithm 1stDefinition: Sequence of steps that can be taken to solve a problem 2ndDefinition: The step.
Introduction to Programming
Basic Concepts of Algorithm
Presentation transcript:

Introduction to Algorithm Session 1 Course: T0974-Algorithm & Object-Oriented Programming I Year: 2011

Bina Nusantara University 3 Learning Outcome After taking this course, students should be expected to explain and discuss their own Algorithms.

Lecture Outline Definition of Algorithm Characteristics of Algorithm Programming Language Algorithm Expression Pseudocode Flowchart NS Diagram Bina Nusantara University 4

Algorithm Definition A precise rule (or set of rules) specifying how to solve some problem wordnetweb.princeton.edu/perl/webwn wordnetweb.princeton.edu/perl/webwn A procedure used to solve a mathematical or computational problem or to address a data processing issue. In the latter sense, an algorithm is a set of step- by-step commands or instructions designed to reach a particular goal. Bina Nusantara University 5

Example Sorting. This algorithm is used to arrange of items or number according of its size. –Input: a set of positive numbers (a 1, a 2, a 3, …, a n ) e.g. 5, 3, 4, 2, 1 –Output: a set of arranged numbers (a’ 1, a’ 2, a’ 3, …, a’ n ) e.g. 1, 2, 3, 4, 5 Example of problems which solved using an Algorithm. –Human Genome Project to identify of human DNA genes. –Search Engines (Yahoo, Google, etc) –GPS Tracking System. Bina Nusantara University 6

Characteristics of Algorithm Input Output Definitness Finiteness Effectiveness Bina Nusantara University 7 An algorithm should have the following five characteristics :

Programming Language A sequence of instructions that a computer can interpret and execute) "the program required several hundred lines of code” --wordnetweb.princeton.eduwordnetweb.princeton.edu Instruction is a line of code written as part of a computer program –wordnetweb.princeton.eduwordnetweb.princeton.edu Example : –COBOL (Common Business Oriented Language) –FORTRAN (FORmula TRANslation) –Ada (Ada Lovelace) –C –C++ (C Based Object-Oriented Programming Languange) –Java Bina Nusantara University 8

Expressing an Algorithm Expressing an Algorithm can be expressed using a method below : Pseudocode Flowchart NS Diagram Bina Nusantara University 9

Psedocode Pseudocode (pronounced SOO-doh-kohd) is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled natural language rather than in a programming language.— WhatIs.com WhatIs.com Bina Nusantara University 10

Pseudocode BEGIN Hold up the phone WHILE not dial Press dial button WHILE not connected Waiting dial IF connected THEN WHILE not finish Talking Hold down the phone END Bina Nusantara University 11 Example of phone calls using pseudocode.

Pseudocode BEGIN Number = Input Number Result = Number % 2 IF Result = 0 THEN Print “The number is even number” ELSE THEN Print “The number is odd number” END Bina Nusantara University 12 Example of Pseudocode to determine odd-even number

Flowchart Schematic representation of process or algorithm. Schematic is a illustration of system in simplified or symbolic form. Bina Nusantara University 13

Bina Nusantara Flowchart Notasi Proses, Data Entry Selection : Flow Lines : Input/Output: Stop Notation : RECTANGLE DIAMOND Start PARALLELOGRAM CIRCLE END Every algorithm process is usually starts from And ends by

Bina Nusantara Flowchart Example of Phone Calling Flowchart Hold up the phone Press dial button Waiting Start Dialing No Yes Connected No Yes Talking Finish No Yes Hold down the phone END

Bina Nusantara Flowchart Example of determining odd-even number Start Input Number Number % 2 Print “Odd Number”Print “Even Number” 01 END

Bina Nusantara NS Diagram NS Diagram is a graphical illustration of structured progamming design. Its method is by drawing a table for illustrating an algorithm. Founded in 1972 by Isaac Nassi & Ben Shneiderman. Known as structograms.

Bina Nusantara NS Diagram Process notation : Selection notation: Loop notation : –WHILE –DO-WHILE Proses Kondisi BetulSalah Kondisi Belum Terpenuhi Proses Kondisi Belum Terpenuhi Proses

Bina Nusantara NS Diagram Example of Phone Calling process using NS Diagram Hold up the phone Dialing? Press dial button Finish? Talking Hold down the phone

Bina Nusantara NS Diagram Insert number Print “Even Number” Number % 2 Equal to 0Equal to 1 Print “Odd Number” Example of NS Diagram to determine odd-even numbers

Did you know ? The word "algorithm" comes from the name of the ninth- century Persian mathematician Mohammed al- Khowarizmi. He wrote a widely read book entitled Kitab al jabr w'al-muqabala (Rules of Restoration and Reduction) in the year of 825. This book describes many procedures for the manipulation of decimal numbers. The word was translated into Latin in the twelve century as “Algoritmi de numero Indorum“ or “Algoritmus on the numbers of the Indians“ Bina Nusantara University 21

Bina Nusantara Referensi Introduction to Algorithms. 2ed. Cormen p5- 13 Introduction to Java Programming. 8ed. Liang p29-30 Algorithm. Pseudocode. Flowchart. NS Diagram.