UE CS 215  Lecture 37 (18 pages)
Previewing pages 1, 2, 3, 4, 5, 6 of 18 page document View the full content.Lecture 37
Previewing pages 1, 2, 3, 4, 5, 6 of actual document.
View the full content.View Full Document
Lecture 37
0 0 84 views
 Pages:
 18
 School:
 University of Evansville
 Course:
 Cs 215  Fundamentals of Programming II
Fundamentals of Programming II Documents

18 pages

24 pages

C++ Programming Style Guideline
7 pages

25 pages

CS 215 – Fundamentals of Programming II
4 pages

6 pages

Tips on Managing Programming Complexity
5 pages

CS 215 Fundamentals of Programming II
11 pages

CS 215 Fundamentals of Programming II Project 3
3 pages

14 pages

18 pages

22 pages

CS 215 Fundamentals of Programming II
5 pages

22 pages

3 pages

CS 215 Fundamentals of Programming II
6 pages

CS 215 Fundamentals of Programming II Project 2
3 pages

18 pages

15 pages

18 pages

19 pages

17 pages

CS 215 Fundamentals of Programming II
6 pages

18 pages

10 pages

17 pages

CS 215 Fundamentals of Programming II
5 pages

2 pages

6 pages

19 pages

CS 215 Fundamentals of Programming II
11 pages

CS 215 Fundamentals of Programming II
6 pages

CS 215 Fundamentals of Programming II
6 pages

CS 215 Fundamentals of Programming II
6 pages

CS 215 – Fundamentals of Programming II  Project 3
3 pages

CS 215 Fundamentals of Programming II
4 pages

21 pages

28 pages

CS 215  Fundamentals of Programming II  Project 2
3 pages

Analysis and Design Style Guideline
8 pages

17 pages

25 pages

CS 215 Fundamentals of Programming II
5 pages

4 pages

16 pages

15 pages

CS 215 – Fundamentals of Programming II
8 pages

14 pages

CS 215 Fundamentals of Programming
7 pages

CS 215  Fundamentals of Programming II
3 pages

CS 215 – Fundamentals of Programming II
4 pages

CS 215 – Fundamentals of Programming I
3 pages

CS 215 Fundamentals of Programming II
9 pages

20 pages

23 pages

13 pages

5 pages

CS 215  Fundamentals of Programming I
9 pages

CS 215 – Fundamentals of Programming II
6 pages

Tips on Managing Programming Complexit
5 pages

18 pages

CS 215 Fundamentals of Programming II Project 7
6 pages

Project 1  CS 215  Fundamentals of Programming I
5 pages

CS 215 Fundamentals of Programming II Project 4
10 pages

CS 215 Fundamentals of Programming II Project 3
4 pages

18 pages

CS 215 Fundamentals of Programming II
3 pages

28 pages

CS 215 Fundamentals of Programming II
6 pages

19 pages

CS 215 Fundamentals of Programming II
6 pages

18 pages

14 pages

CS 215 – Fundamentals of Programming II
6 pages

2 pages

17 pages

22 pages

CS 215 Fundamentals of Programming I
7 pages

CS 215 Fundamentals of Programming II
5 pages

18 pages
Sign up for free to view:
 This document and 3 million+ documents and flashcards
 High quality study guides, lecture notes, practice exams
 Course Packets handpicked by editors offering a comprehensive review of your courses
 Better Grades Guaranteed
Unformatted text preview:
Lecture 37 Log into Linux We will be adding code to files sort h and sort examples cpp from last class Reminder Homework 13 due today Reminder Project 7 due on Friday No class on Friday CS Senior Project presentations 1 00 2 30 or so in KC 267 Office hours 3 4 30 Project 8 posted includes material to be covered next week due last day of class Questions Wednesday April 13 CS 215 Fundamentals of Programming II Lecture 37 1 Outline More Sorting Quicksort 2nd half of Section 13 2 More algorithm analysis O nlog2n running time Worst case average case Wednesday April 13 CS 215 Fundamentals of Programming II Lecture 37 2 Sorting Recall Applications often require data to be sorted For a vector v with n elements this means the elements are arranged such that v 0 v 1 v n 2 v n 1 There are lots of different algorithms Last time we look at a couple of slow O n 2 algorithms Today we will look at a fast algorithm Wednesday April 13 CS 215 Fundamentals of Programming II Lecture 37 3 Divide and Conquer One class of recursive algorithms is called divide and conquer The basic idea is to divide the problem in two or more approximately equal sized subproblems solve them directly or recursively then combine the subproblem results into the result for the original problem Section 13 2 covers two sorting algorithms mergesort and quicksort that use this method We will cover only quicksort Wednesday April 13 CS 215 Fundamentals of Programming II Lecture 37 4 Quicksort Note the textbook presents a method for sorting arrays that uses pointer arithmetic We will be sorting vectors so we will be using indexes first last to indicate the range to be sorted One of the reasons that sorting algorithms like selection and insertion sort are so slow is that the exchanges do not move the elements very far Quicksort attempts to speed this up by making the exchanges more effective Wednesday April 13 CS 215 Fundamentals of Programming II Lecture 37 5 Quicksort The basic idea of quicksort is to arrange the
View Full Document