COEN 179 Lecture Notes - Lecture 25: Selection Sort, Search Algorithm

11 views5 pages

Document Summary

Coen 179 lecture 24 p, np, np-hardness, np-completeness notes. Selection sort takes about 6 months to sort 10^8 names on a typical laptop. Maybe not for large degree, but it is advantageous to consider all polynomials as fast running time for theoretical purposes. Def: the class p consists of problems whose solutions can be found with an algorithm whose running time is bounded above some polynomial n^k. Max in p since there is an o(n) algorithm to find largest value of n items. Sorting in p because there is an o(n^2) algorithm to sort n items. Primality in p because there is an o(n^6) algorithm to determine whether an integer is prime or not. Some important problems for which no known poly time algorithm has been found. e. g. partition. Output: true if we can partition s[1n] into 2 arrays a[1k] Instance: s = [10, 8, 36, 4, 4, 4, 4, 2, 5, 5, 1, 1, 1, 7]

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents