{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lect01 - Lecture 1 Introduction What is an Algorithm An...

This preview shows pages 1–11. Sign up to view the full content.

Lecture 1 Introduction

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
What is an Algorithm ? An algorithm is a computational procedure that takes some value, or a set of values, as input and produces some values, or a set of values, as output . So, it is a sequence of computational steps that transform the input into the output. Correction: sequence -> combination
Sequential and Parallel In sequential computation , an algorithm is a sequence of computational steps. However, it is not true in parallel computation . In this course, we study only algorithms in sequential computation.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms for Sorting . ' ' ' such that sequence input of } ' ,..., ' , ' { n permutatio A : Output }. ,..., , { numbers of sequence A : Input 2 1 2 1 2 1 n n n a a a a a a a a a n Insertion Sort, Merge Sort 6. 5, 4, 3, 2, 1, : Output 3. 1, 6, 4, 2, 5, : Input e.g.,
Efficiency Running time from receiving the input to producing the output. ) log ( ) ( 2 n n O n O Insert Sort Merge Sort Running time

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
. for ) ( ) ( 0 such that 0 and 0 constants exist there means )) ( ( ) ( 0 0 n n n cg n f n c n g O n f =
function! the of growth the is about care really what we Therefore, . log large, ly sufficient is When bigger? is who , log and 2 2 1 2 2 1 n n c n c n n n c n c

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
key i A i i i A i A key i A i j i j A key A length j + - + - ] 1 [ 1 ] [ ] 1 [ do ] [ and 0 while 1 ] [ do ] [ to 2 for Insertion Sort A array input
for. - end ; ] 1 [ while; - end ; 1 ]; [ ] 1 [ begin do ] [ and 0 while ; 1 ]; [ begin do ] [ to 2 for key i A i i i A i A key i A i j i j A key A length j + - + -

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
3 1, , 6 5,
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 32

lect01 - Lecture 1 Introduction What is an Algorithm An...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online