lect01 - Lecture 1 Introduction What is an Algorithm ? •...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture 1 Introduction 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. 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 . for ) ( ) ( such that and constants exist there means )) ( ( ) ( 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 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 while 1 ] [ do ] [ to 2 for Insertion Sort A array input for.- end ; ] 1 [ while;- end ; 1 ]; [ ] 1 [ begin do ] [ and 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 ← +- ← ← +- ← ← ← 3...
View Full Document

This note was uploaded on 11/03/2010 for the course COMPUTER S CS 6363 taught by Professor Dingzhudu during the Fall '10 term at University of Texas at Dallas, Richardson.

Page1 / 32

lect01 - Lecture 1 Introduction What is an Algorithm ? •...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online