Algorithms and Algorithmic Thinking. Instructions on making a Jam Sandwich.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

CS1010 Programming Methodology
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
State Space Search Algorithms CSE 472 Introduction to Artificial Intelligence Autumn 2003.
Computer Software & Software Development H&K Chapter 1 Instructor – Gokcen Cilingir Cpt S 121 (June 20, 2011) Washington State University.
What is an algorithm? Informally: An Algorithm is a step by step method for solving a problem. It’s purpose is to break a larger task down so that each.
Recursion. Binary search example postponed to end of lecture.
Program Design and Development
Chapter 2 The Algorithmic Foundations of Computer Science
Unit 171 Algorithms and Problem Solving  Introduction  Algorithm Design  Algorithm Properties  Algorithm Control Flow  Examples  Comparing Algorithms.
Module 12 Computation and Configurations Formal Definition Examples.
1 Algorithms and Problem Solving. 2 Outline  Problem Solving  Problem Solving Strategy  Algorithms  Sequential Statements  Examples.
1 Two-Dimensional Arrays. 2 Can be visualized as consisting m rows, each of n columns Syntax: datatype arrayname [row] [ column] ; Example: int val[3]
Chapter 2 Recursion: The Mirrors. © 2005 Pearson Addison-Wesley. All rights reserved2-2 Recursive Solutions Recursion is an extremely powerful problem-
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Design and Analysis of Algorithms - Chapter 11 Algorithm An algorithm is a.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
Original Source : and Problem and Problem Solving.ppt.
Adapted from slides by Marie desJardins
Algorithm Analysis Dr. Bernard Chen Ph.D. University of Central Arkansas.
Introduction Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
Data Structures Using C++ 2E Chapter 6 Recursion.
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.
1 Intro to Computer Science I Chapter 1 Introduction to Computation Algorithms, Processors, and Programs.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
Algorithms, Algorithmic Thinking and Structured Code.
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
Data Structures Using C++ 2E Chapter 6 Recursion.
Abstraction and Abstract Thinking Part 1 “Algorithms” Part 2 “Abstract Networks”
Problem Solving and Algorithms
Reynolds 2006 Complexity1 Complexity Analysis Algorithm: –A sequence of computations that operates on some set of inputs and produces a result in a finite.
Week 5 - Monday.  What did we talk about last time?  Linked list implementations  Stacks  Queues.
By the end of this session you should be able to...
“The study of algorithms is the cornerstone of computer science.” Algorithms Fall 2011.
Introduction to Algorithms By Mr. Venkatadri. M. Two Phases of Programming A typical programming task can be divided into two phases: Problem solving.
Algorithms, Part 1 of 3 Topics  Definition of an Algorithm  Algorithm Examples  Syntax versus Semantics Reading  Sections
Logic (continuation) Boolean Logic and Bit Operations.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Chapter 2: General Problem Solving Concepts
Chapter Algorithms 3.2 The Growth of Functions 3.3 Complexity of Algorithms 3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors.
1 Section 2.1 Algorithms. 2 Algorithm A finite set of precise instructions for performing a computation or for solving a problem.
Chapter 8 Algorithms.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
©Brooks/Cole, 2003 Chapter 8 Algorithms. ©Brooks/Cole, 2003 CONCEPTCONCEPT 8.1.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Data Structures Arrays and Lists Part 2 More List Operations.
1 Chapter 8 Recursion. 2 Recursive Function Call a recursion function is a function that either directly or indirectly makes a call to itself. but we.
Basic Concepts 2011, Fall Pusan National University Ki-Joune Li.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
Algorithm Complexity Analysis (Chapter 10.4) Dr. Yingwu Zhu.
CMSC 104, L041 Algorithms, Part 1 of 3 Topics Definition of an Algorithm Example: The Euclidean Algorithm Syntax versus Semantics Reading Sections 3.1.
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
Algorithms, Part 1 of 3 The First step in the programming process
Algorithms, Part 1 of 3 Topics Definition of an Algorithm
COSC160: Data Structures Linked Lists
Lecture 2: Introduction to Algorithms
Chapter 18-3 Recursion Dale/Weems.
Parallel Computation Patterns (Scan)
Algorithms Key Revision Points.
ECE408 Applied Parallel Programming Lecture 14 Parallel Computation Patterns – Parallel Prefix Sum (Scan) Part-2 © David Kirk/NVIDIA and Wen-mei W.
ICT Programming Lesson 3:
Algorithms, Part 1 of 3 Topics Definition of an Algorithm
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Introduction to Computer Science
Algorithms, Part 1 of 3 Topics Definition of an Algorithm
Presentation transcript:

Algorithms and Algorithmic Thinking

Instructions on making a Jam Sandwich

Origins of Algorithms Dinsdag 6 augustus 2002 is de Nederlandse informaticus Edsger Wybe Dijkstra overleden. Hij werd over de hele wereld beroemd door zijn ideeën over gestructureerd programmeren.

“Peeling Potatoes for a Family Supper” We observe the cook doing this “He gets the potato basket from the cellar, gets the pan from the cupboard, peels the potatoes returns the basket to the cellar” Sequence

“Go to the other side of the road” “Go to Hell” Meaningful Instructions Effective

Meaningful Instructions Unambiguous A wedding journalist reported that the four bridesmaids wore the same dress.

Instructions “He gets the potato basket from the cellar, gets the pan from the cupboard, peels the potatoes returns the basket to the cellar” get the potato basket from the cellar, get the pan from the cupboard, peel the potatoes return the basket to the cellar Sequence Correct Order

Jordan does something different get the potato basket from the cellar, get the pan from the cupboard, IF clothes are light colored THEN put on an apron peel the potatoes return the basket to the cellar IF some condition THEN some action Selection

“peel the potatoes” Halting

“peel the potatoes” IF number of peeled potatoes is not sufficient THEN peel a potato

“peel the potatoes” WHILE the number of potatoes is insufficient DO peel a potato get the potato basket from the cellar, get the pan from the cupboard, IF clothes are light colored THEN put on an apron WHILE the number of potatoes is insufficient DO peel a potato return the basket to the cellar WHILE condition is true DO an action Iteration

“peel the potatoes” WHILE condition is true DO an action Instruction Blocks WHILE condition is true DO action1 action2 action3

Algorithms – a definition Sequence of Instructions (ordered) Instructions are Effective and Unambigous Sequence must Halt in a finite time On halting, the sequence must have a Result Instructions may be Simple Actions Selections Iterations action IF condition THEN action WHILE condition is true DO action

DanielBobGrantAnneCarolNathanSue Sequential Search Algorithm - Example

DanielBobGrantAnneCarolNathanSue Sequential Search Algorithm - Example

Daniel BobNathan AnneCarolGrantSue Binary Search (Tree Representation) L LL H HH

Password Cracker Passwords created with lower case only a…z

Computational Thinking

Pseudo-code and Code there is a list of numbers get the length of the list set the value of sum to zero while the end of the list has not been reached get the next value in the list add this to the sum display the sum int numArray[2]; int len; int index; int sum; numArray[0] = 3; numArray[1] = 4; length = numArray.length; index = 0; sum = 0; while(index <= length) { sum = sum + numArray[index]; index = index + 1; } printf(“Sum is %d”, sum);

get the potato basket from the cellar, get the pan from the cupboard, peel the potatoes return the basket to the cellar

I Have A Lovely Bunch Of Coconuts

x = 5 Y = 3 Temp = X X = Y Y = Temp

Music Algorithmic?