Содержание
- 2. A Lower Bound for Sorting Rules for sorting. The lower bound on comparison sorting. Beating the
- 3. “if this element’s sort key is less than this other element’s sort key, then do something,
- 4. 1) each sort key is either 1 or 2, 2) the elements consist of only sort
- 5. =>go through every element and count how many of them are 1s; let’s say that k
- 6. Rules for sorting
- 7. The lower bound on comparison sorting A comparison sort is any sorting algorithm that determines the
- 8. The lower bound on comparison sorting This is the lower bound: In the worst case, any
- 9. The lower bound on comparison sorting We write: Ω-notation (It gives a lower bound) We say:
- 10. The lower bound on comparison sorting 1) Lower bound is saying something only about the worst
- 11. The lower bound on comparison sorting A universal lower bound => applies to all inputs. For
- 12. The lower bound on comparison sorting 2) The lower bound does not depend on the particular
- 13. Beating the lower bound with counting sort Procedure REALLY-SIMPLE-SORT
- 14. Beating the lower bound with counting sort Procedure COUNT-KEYS-EQUAL
- 15. Beating the lower bound with counting sort Example. Let’s we know that the sort keys are
- 16. Beating the lower bound with counting sort Generalize. If k elements have sort keys equal to
- 17. Beating the lower bound with counting sort What should be done? We want to compute, for
- 18. Beating the lower bound with counting sort Computing: how many elements have sort keys equal to
- 19. Beating the lower bound with counting sort Notice that COUNT-KEYS-EQUAL never compares sort keys with each
- 20. Beating the lower bound with counting sort Since the first loop (step 2) makes m iterations,
- 21. Beating the lower bound with counting sort Computing: how many elements have sort keys less than
- 22. Beating the lower bound with counting sort Example. Suppose that m = 7, so that all
- 23. Beating the lower bound with counting sort Then equal = (1; 3; 0; 1; 1; 3;
- 24. Beating the lower bound with counting sort less = (0; 1; 4; 4; 5; 6; 9)equal
- 26. Example.
- 30. Beating the lower bound with counting sort The idea is that, as we go through the
- 31. Beating the lower bound with counting sort The loop of step 2 sets up the array
- 32. Beating the lower bound with counting sort For each element A[i], step 3A stores A[i] into
- 33. Beating the lower bound with counting sort How long does REARRANGE take? The loop of step
- 34. Beating the lower bound with counting sort Counting sort
- 35. Beating the lower bound with counting sort The running times of COUNT-KEYS-EQUAL Θ(m+n); COUNTKEYS-LESS Θ(m); REARRANGE
- 36. Beating the lower bound with counting sort Counting sort beats the lower bound of Ω(n lg
- 37. Beating the lower bound with counting sort If the sort keys were real numbers with fractional
- 38. Beating the lower bound with counting sort The running time is Θ(n) if m is a
- 39. Beating the lower bound with counting sort Sorting exams by grade. The grades range from 0
- 40. Beating the lower bound with counting sort Counting sort has another important property: it is stable.
- 41. Radix sort Let’s you had to sort strings of characters of some fixed length. For example,
- 42. Radix sort 36 characters => numeric from 0 to 35 The code for a digit =>
- 43. Radix sort Simple example. Confirmation code comprises two characters. using the rightmost character as the sort
- 44. Radix sort Simple example. BUT using the leftmost character as the sort key using the rightmost
- 45. Radix sort Example.
- 47. Скачать презентацию
 Slaidy.com
 Slaidy.com






























![Beating the lower bound with counting sort For each element A[i], step](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/851702/slide-31.jpg)













 Метаболическая эффективность различных режимов напряженной мышечной деятельности переменного характера
 Метаболическая эффективность различных режимов напряженной мышечной деятельности переменного характера Тема педагогического совета: «Формирование базовых компетентностей - одно из главных направлений модернизации образования»
 Тема педагогического совета: «Формирование базовых компетентностей - одно из главных направлений модернизации образования» Великобритания (Соединенное Королевство Великобритании и Северной Ирландии)
 Великобритания (Соединенное Королевство Великобритании и Северной Ирландии) Научно – методические подходы к планированию курсов истории
 Научно – методические подходы к планированию курсов истории У меня растут года
 У меня растут года Презентация на тему Народная одежда Курской губернии
 Презентация на тему Народная одежда Курской губернии Айелинг: Новая жизнь.
 Айелинг: Новая жизнь. Применение личностно-ориентированного подхода в обучении химии
 Применение личностно-ориентированного подхода в обучении химии поздравление на 8 марта
 поздравление на 8 марта Значение символов
 Значение символов Хэки в Perl
 Хэки в Perl Техника безопасности при выполнении машинных работ
 Техника безопасности при выполнении машинных работ Керамические материалы и изделия. Тема 3
 Керамические материалы и изделия. Тема 3 СИАМ консалтинг: аутсорсинг функции Service Desk
 СИАМ консалтинг: аутсорсинг функции Service Desk Съемные позиционеры для фиксации Прозрачное исполнение Полностью прозрачный пассивный самолигирующий брекет с присущим ему низк
 Съемные позиционеры для фиксации Прозрачное исполнение Полностью прозрачный пассивный самолигирующий брекет с присущим ему низк Hager Tehalit
 Hager Tehalit Журналист
 Журналист Методика работы с учебно-познавательными (информативными) текстами
 Методика работы с учебно-познавательными (информативными) текстами БДЕШ А СЖ ортопедия
 БДЕШ А СЖ ортопедия MD Consult: мировой лидер среди электронных продуктов для медицины
 MD Consult: мировой лидер среди электронных продуктов для медицины Викторина по детским фильмов
 Викторина по детским фильмов Семинар_лекция_2
 Семинар_лекция_2 Историки Античности
 Историки Античности Процессуальные особенности трудовых споров
 Процессуальные особенности трудовых споров Экскурсия в мир профессий
 Экскурсия в мир профессий Предложение партнерства с Теле2
 Предложение партнерства с Теле2 Маркетинговые исследования. Характеристика, тенденции развития, методика проведения
 Маркетинговые исследования. Характеристика, тенденции развития, методика проведения Презентация на тему Великие символы России
 Презентация на тему Великие символы России