FUNDAMENTALS OF ALGORITHMS MCS - 2 LECTURE # 2. MODEL OF COMPUTATION REPRESENTATION OF ALGORITHMS.

Slides:



Advertisements
Similar presentations
CSCI 311 – Algortihms and Data Structures Steve Guattery Dana 335a (department office) x7-3828
Advertisements

PROBLEM SOLVING TECHNIQUES
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Give qualifications of instructors: DAP
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Algorithms and Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Fundamentals of Algorithms MCS - 2 Lecture # 4
I Advanced Algorithms Analysis. What is Algorithm?  A computer algorithm is a detailed step-by-step method for solving a problem by using a computer.
ITEC113 Algorithms and Programming Techniques
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
CSC401 – Analysis of Algorithms Lecture Notes 1 Introduction
Basic Elements of Programming A VB program is built from statements, statements from expressions, expressions from operators and operands, and operands.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
A452 – Programming project – Mark Scheme
Chapter 1 Program Design
Pseudocode.
Review Algorithm Analysis Problem Solving Space Complexity
PRE-PROGRAMMING PHASE
Fundamentals of C programming
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Intro to CS – Honors I Introduction GEORGIOS PORTOKALIDIS
DCT 1123 Problem Solving & Algorithms
Computability and Modeling Computation What are some really impressive things that computers can do? –Land the space shuttle (and other aircraft) from.
Simple Program Design Third Edition A Step-by-Step Approach
CIS Computer Programming Logic
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
CSC141 Introduction to Computer Programming
Compiler Chapter# 5 Intermediate code generation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
JAVA 0. HAFTA Algorithms FOURTH EDITION Robert Sedgewick and Kevin Wayne Princeton University.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
1 Problem Solving We now have enough tools to start solving some problems. For any problem, BEFORE you start writing a program, determine: –What are the.
Grading Exams 60 % Lab 20 % Participation 5% Quizes 15%
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
Algorithms & Flowchart
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
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.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Advanced Algorithms Analysis and Design
The material in this lecture should be review. If you have not seen it before, you should be able to learn it quickly – and on your own. So we are going.
Advanced Algorithms Analysis and Design
Data Structures and Algorithms
Lecture 3 of Computer Science II
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
Introduction to Computer Programming
Learning to Program in Python
Objective of This Course
Introduction to Algorithms
ME 142 Engineering Computation I
Algorithm Analysis and Design
Lecture 6 Architecture Algorithm Defin ition. Algorithm 1stDefinition: Sequence of steps that can be taken to solve a problem 2ndDefinition: The step.
Basic Concepts of Algorithm
Design and Analysis of Algorithms
WJEC GCSE Computer Science
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Design and Analysis of Algorithms
Presentation transcript:

FUNDAMENTALS OF ALGORITHMS MCS - 2 LECTURE # 2

MODEL OF COMPUTATION REPRESENTATION OF ALGORITHMS

MODEL OF COMPUTATION Unlike programs, algorithms are to be understood primarily by people and not machines. This gives us flexibility to present the algorithms, any many low-level details may be omitted. In order to say any thing meaningful about algorithms, a mathematical model of computation is used. A generic one-processor model is assumed as implementation technology of algorithms. This model is called RAM.

RAM; RANDOM ACCESS MACHINE A RAM is an idealized machine with an infinitely large random-access memory. Instructions are executed one-by-one. Each instruction performs some basic operation on two values in machine memory. It is assumed that each basic operation takes same constant time to execute.

BASIC RAM OPERATIONS Assigning a value to a variable, Computing any basic arithmetic operation (+, -, *, /) on integer values of any size, Performing any comparison or Boolean operations, Accessing an element of an array.

REPRESENTATION OF ALGORITHMS

ESSENTIAL ELEMENTS OF A GOOD REPRESENTATION Show the logic of how the problem is solved - not how it is implemented. Readily reveal the flow of the algorithm. Be expandable. Lend itself to implementation of the algorithm.

SHOW THE LOGIC Distinguish between the concept of problem logic and implementation logic. E.g find the Area of Circle It doesn't matter whether you are solving the problem with a C program, a Java program, a calculator, a pencil and paper, or in your head - those elements are part of the logic of solving the problem. Your algorithm representation should focus on the logic of the problem, and not the logic of the eventual implementation.

REVEAL THE FLOW Most problems, especially if they are intended to be solved with the aid of a computer program, involve flow control. In the "structured programming", this flow control consists of sequences, selections, and repetitions. decisions will have to be made and different steps taken depending on the outcome of those decisions. The representation method show the points at which decisions are made and what the various courses of action are that can result.

BE EXPANDABLE Our algorithm representation should be flexible and allow us to readily collapse it or to expand it We expand our algorithm and become more detailed, at some point we have to get into the logic of the implementation issues. For instance, if we expand the step that says to take the square root of a number, we have to start describing the specific method that will be used to do this and that method is highly dependent on the eventual implementation.

AID IN IMPLEMENTATION The goal is to actually implement a solution to the problem being solved. If our method of representing our algorithm does not lend itself to an orderly implementation of that algorithm, then our method is seriously flawed. Conversely, if our method of representation lends itself to a systematic implementation of the algorithm, then our method is extremely useful. By "systematic implementation" we mean that we should be able to take our represented algorithm and break it into easily identifiable fragments each of which can be readily translated.

REPRESENTATION OF ALGORITHMS Algorithms are generally represented by either Pseudo code Flowchart

GOOD LUCK ! ☻