Содержание
- 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. Скачать презентацию






























![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)













Самый лучший ракурс
Понятие преступления в уголовном праве
Прямое плетение. Плетеный объемный короб
Стимулирующие критерии на уровне ОУ
Знайте правила движения, как таблицу умножения!
Управление персоналом как наука
Субпродукты. Классификация
ВКР: Разработка технологии ремонта барабана фрикциона гидроподжимной муфты трактора ХТЗ 17221
Радио
Содержание права акционеров на получение информации о хозяйственном обществе
ТЕМА № 3 (ХПИ)
Гостиница. Практическая работа
«ОДАРЕННЫЕ ДЕТИ и особенности работы с ними» Педагогический совет МБОУ «Каратузская СОШ» от 12.01.2012года
Большой театр 5 класс
Продажа непродовольственных товаров
Исследование и разработка источниковмикроволнового и оптического излучения дляизучения воздействия его на биологические объек
маловідомих місць Західно Украни
It’s good to be a child
Великая Отечественная война 1941 – 1945 гг. Мы помним. Мы не имеем права забыть подвиг, который совершил российский народ. Мы помним стр
Подготовка к сдаче отчета за 2011 год по финансово-статистической форме № 62 «Сведения об оказании и финансировании медицинской пом
Тайны эквилибра
Создание спортивно-оздоровительного комплекса Вейк-парк на озере Святое, с благоустройством части территории
Студенческий конкурс по арбитражу корпоративных споров им. В.П. Мозолина
Графические работы по дисциплине черчение и перспектива
ИИНТЕЛЛЕКТУАЛЬНО - ТВОРЧЕСКИЙ ПРОЕКТ «В гостях у сказки»
Отбор племенных производителей и подбор племенных пар в условиях частного кинологического питомника
Поверхностно-активные вещества
Осень-это