• Tidak ada hasil yang ditemukan

Design and Analysis of Algorithms

N/A
N/A
Protected

Academic year: 2024

Membagikan "Design and Analysis of Algorithms"

Copied!
6
0
0

Teks penuh

(1)

Design and Analysis of Algorithms

ผศ. ดร. สมชาย ประสิทธิ์จูตระกูล ภาควิชาวิศวกรรมคอมพิวเตอร

จุฬาลงกรณมหาวิทยาลัย 2542

คําเตือน

เนื้อหาอันรวมถึงขอความ ตัวเลข สัญลักษณ รูปภาพ และ คําบรรยาย อาจมีขอผิดพลาดแฝงอยู ผูจัดทําจะไมรับผิด ชอบตอความเสียหายทั้งทางดานผลการเรียน สุขภาพกาย และสุขภาพจิตใดๆ อันเนื่องมาจากการใชสื่อการเรียนนี้

Algorithm Design Techniques

Incremental Technique

Outline

• Incremental technique

• Examples – Maximum – Sorting – Convex Hull

• Conclusion

Incremental

• Consider the input incrementally

Incremental( input[1..n] ) {

S[0] = null for i = 1 to n

S[i] = Solve( S[i-1], input[i] ) return S[n]

}

Maximum

12 25 11 14 30 29 21

(2)

Maximum

12 25 11 14 30 29 21

Max : 12

Maximum

12 25 11 14 30 29 21

Max : 25

Maximum

12 25 11 14 30 29 21

Max : 25

Maximum

12 25 11 14 30 29 21

Max : 25

Maximum

12 25 11 14 30 29 21

Max : 30

Maximum

12 25 11 14 30 29 21

Max : 30

(3)

Maximum

12 25 11 14 30 29 21

Max : 30

Θ( n )

Insertion Sort

Insertion Sort Insertion Sort

Insertion Sort Insertion Sort

(4)

Insertion Sort Insertion Sort

Insertion Sort Insertion Sort

Insertion Sort Insertion Sort

Θ( n2 )

(5)

Convex Hull

1

6

2

8 7 5

4 3

Convex Hull

1

6 3

2

8 7 5

4

Convex Hull

1

6 3

2

8 7 5

4

Convex Hull

1

6 3

2

8 7 5

4

Convex Hull

1

6 3

2

8 7 5

4

Convex Hull

1

6 3

2

8 7 5

4

Θ( n2 )

(6)

Conclusion

• Incremental construction of solution

• Easy and straight-forward implementation

• Usually there are better ways to solve the same problem

Referensi

Dokumen terkait

Due to its advantages of easy to be manufactured and easy to be repaired, space frame chassis is the most favorite choice for race car development of newly introduced varsity

Sometimes only few processors can be used to generate all m-permutations of n items. A surpris- ingly simple parallel algorithm can be developed for this situation. The algorithm

Implementation of BILP Problem using Julia, Python and Minizinc With 15 cases each for easy, moderate, hard, and extremely hard difficulty levels, the BILP formulation is used to solve

Consider the following slightly modified algorithm: GreedySortMakespan - Consider jobs in decreasing order of duration - While all jobs are not assigned - Assign the next job as per

Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers

Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers

Hardware implementation of the star tracking algorithm using parallel and pipelined architecture is a proper solution to ensure higher accuracy as well as higher update rate.. Noise

Sri Chandrasekharendra Saraswathi Viswa Mahavidyalaya Department of Computer Science and Engineering Page 64 of 162 Syllabus B.E[CSE] Full Time L T P C 3 2 0 3 CS4T4 - DESIGN AND