/
05 | 20090224   Algorithm & Efficiency 05 | 20090224   Algorithm & Efficiency

05 | 20090224 Algorithm & Efficiency - PowerPoint Presentation

dardtang
dardtang . @dardtang
Follow
348 views
Uploaded On 2020-07-03

05 | 20090224 Algorithm & Efficiency - PPT Presentation

Fazmah Arif Yulianto CS1013 Pengantar Teknik Informatika 20082 Lets get serious I Pen and Paper Bagaimana kita melakukan perkalian bilangan Hafalan ID: 793785

amp algorithm output memory algorithm amp memory output input persons algoritma algorithms menggunakan fast complicated bilangan number cust mins

Share:

Link:

Embed:

Download Presentation from below link

Download The PPT/PDF document "05 | 20090224 Algorithm & Efficien..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

05 | 20090224 Algorithm & Efficiency

Fazmah Arif Yulianto

CS1013 –

Pengantar

Teknik

Informatika

-

20082

Slide2

Slide3

Let’s get serious

Slide4

I: Pen and PaperBagaimana kita melakukan

perkalian bilangan?Hafalan

Dengan

Bantuan

Tangan

Kertas

Kalkulator

Manakah

yang

merupakan

Algoritma

?

Slide5

Menggunakan Angka Arab 2345 678 x 18760

16415 14070 + 1589910

Mengalikan menggunakan Kertas

Angka Romawi

MMCCCVL

DLXXVIII x

?

Slide6

Ciri algoritma:

TerencanaDapat dilakukan

Selesai

Algorithm

Input

Computational steps

Output

Slide7

Using natural languageUsing flowchart

Using pseudocodeUsing program source code

Specifying an algorithm

Slide8

Correctness100%Approx alg

 the error < limitEfficiency:Time & Space efficiency

Simplicity

Generality:

the problem

input range

Algorithm Qualities

Slide9

3 Komponen AlgoritmaParadigma IPOSetiap

Algoritma dapat disebutkan:Input : masukan

Proses

: me-

‘*^%$’

-

kan

I

 O

Output :

keluaran

Slide10

Latihan I: Pen and PaperPada Algoritma perkalian

menggunakan kertas, sebutkan IPOnya.

Input :

Dua

buah

bilangan

Proses

:

<pre-memory>

Output :

Bilangan hasil perkalian

Slide11

II: Resep MasakanResep membuat Cap CayInput : Bahan Masakan, dan Cara MemrosesnyaProses : <interpretasi> <urutan>Output : Cap Cay untuk 6 orang

Slide12

Morale IISingkat, ada

Asumsi, Kamus dan atau Knowledge BaseMemungkinkan

Paralel

Processing

Garnish,

Kuah

,

Utama

,

Isi

,

dsb Adanya Konsep ModularityBakso, Maizena, tinggal pake

’ ajaInput – Output - Movement

Slide13

The Need of Efficient AlgorithmSuppose that you have an infinitely fast computer equipped with unlimited capacity of free-memory.

Do you still have any reason to study algorithm?

Slide14

Absolutely YES!You still have to demonstrate that your solution method terminates and does so with the correct answer

Slide15

Back to the real worldComputers may be fast, but they are not infinitely fastMemory may be cheap, but it is not free.

Bounded resources:Computing timeSpace in memory

Energy (mind your laptop battery) etc.

These resources must be used wisely, and efficient algorithms will help you do so

Slide16

Performance: the amount of CPU / memory / disk usage / energy etc.Complexity: how well the algorithm scalesBig-Othe number of operations required to perform a function

expression representing some growth relative to the size of the problem (N)Exp: O(1), O(N), O(N2), O(log N), …

Efficiency

Slide17

an algorithm takes constant time to run; performance isn’t affected by the size of the problemExp: addressing main memory in a computerarray lookup

O(1)

Slide18

the number of operations required to perform a function is directly proportional to the number of items being processedExp: waiting in a line at a supermarketAssume: 2 mins

/ cust (avg)10 cust

 20

mins

; 100

cust

 200

mins

O(N)

Slide19

Each member of the group greets every other memberO(N2)

6 persons

 5+4+3+2+1 = 15

7 persons  21

8 persons  28

N persons  (N

2

-N)/2 greets

Slide20

Big O disregard any constant  (N2-N)as N becomes larger, subtracting N from N2

will have less and less of an overall effectO(N2): (N

2

-N)/2

N

2

Slide21

Fast algorithms often make use of very complicated data structures, or use other complicated algorithms as subroutinesChallenge: making more complicated algorithms worthy of consideration in practice

Implementation Complexity

Slide22

The world without computer engineers

Slide23

Kur

IF 2008

Slide24

Let’s do some actions

Slide25

Write your algorithm(s) to sort cards from the same suit:You can see all the cards & you can use your both handsCards are all placed face down on the table & you can only use one handWhat is your: average step-count?

Do you find special cases (worst & best)?Card Sorting

Slide26

Try to put eight chess queens on an 8×8 chessboard such that none of them is able to capture any other using the standard chess queen's moves8-Queens Puzzle