PPT-Lecture 39: searching and sorting

Author : ginocrossed | Published Date : 2020-08-07

Adapted from slides by Marty Stepp and Stuart Reges CSc 110 Spring 2017 Using binarysearch index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 a 4 2 7 9 15 19

Presentation Embed Code

Download Presentation

Download Presentation The PPT/PDF document "Lecture 39: searching and sorting" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Lecture 39: searching and sorting: Transcript


Adapted from slides by Marty Stepp and Stuart Reges CSc 110 Spring 2017 Using binarysearch index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 a 4 2 7 9 15 19 25 28 30 36 42 50 56 68 85 . 1 Overview In this lecture we discuss the notion of lower bounds in particular for the problem of sorting We show that any deterministic comparisonbased sorting algo rithm must take 8486 log time to sort an array of elements in the worst case We th 1 Overview In this lecture we discuss the notion of lower bounds in particular for the problem of sorting We show that any deterministic comparisonbased sorting algo rithm must take 8486 log time to sort an array of elements in the worst case We th P. arallel Sorting. Shantanu. . Dutt. ECE Dept.. UIC. Acknowledgement. Adapted from Chapter 9 slides of the text, by A. . Grama. w/ a few changes, augmentations and corrections. Topic Overview . Issues in Sorting on Parallel Computers . 6.1 Bits and digits Extracting bits is easy in C 6.2 Extracting digits with macros Ex: Single-byte access: bitsbyte = 8 x = 0X61626364Single-bit access: bitsbyte = 1 digit(x, 11) Algorithms. Step by step recipe to do a task…. Algorithms. Step by step recipe to do a task where:. Operations are . computable. Operations are . unambiguous. Operations are . well ordered. Finite number . Mathematical Definition. Types of Sorting Algorithms. Permutation Sort. Cost of Sorting Algorithms. 2 Main Sorting Functions. Simple Sorts. Insertion. Bubble. Selection. Insertion Sort: Example. Insertion Sort: Example. Bubble Sort . of an array. Inefficient --- . O ( N. 2. ). easy to code. , . hence unlikely to contain errors. Algorithm. for . outerloop. = 1 to N. for . innerloop. = 0 to N-2. if ( item[. -The Sorting Hat, . Harry Potter and . the Sorcerer's Stone. Searching. Given an array of ints, find the index of an int key. For key = 27 and the above array, a search function returns 2. If it's not present, often returns negative value. David Woodruff. Carnegie Mellon University. Theme: Tight Upper and Lower Bounds. Number of comparisons to sort an array. Number of exchanges to sort an array. Number of comparisons needed to find the largest and second-largest elements in an array. Lecture 18 SORTING in Hardware SSEG GPO2 Sorting Switches LED Buttons GPI2 Sorting - Required I nterface Sort Clock R eset n DataIn N DataOut N Done RAdd L WrInit S (0=initialization 1=computations) The Desired Brand Effect Stand Out in a Saturated Market with a Timeless Brand The Desired Brand Effect Stand Out in a Saturated Market with a Timeless Brand The Desired Brand Effect Stand Out in a Saturated Market with a Timeless Brand The Desired Brand Effect Stand Out in a Saturated Market with a Timeless Brand

Download Document

Here is the link to download the presentation.
"Lecture 39: searching and sorting"The content belongs to its owner. You may download and print it for personal use, without modification, and keep all copyright notices. By downloading, you agree to these terms.

Related Documents