Download presentation
Presentation is loading. Please wait.
1
CS 280 Data Structures Professor John Peterson
2
Test #1 We’ll do a test next week on Wednesday. It will take the entire period. You can have 1 page of notes. Think about all of the homework / projects / quizzes we’ve had. I’ll be doing something similar. There will be a little programming.
3
Project #6 Questions?
4
Quiz Let’s look at quiz 5 (No quiz today! I’ll save it for the test) Array {1,4,2,5,3} Even split call tree Lowest value call tree
5
One Last Sort There’s another way to do “divide and conquer” – what other way can we divide up the input at each step?
6
Merge Sort Let’s divide the input exactly in half in terms of size. The problem is that now if we sort the two subarrays they can’t just be fused together to make the big array without any work. Merge sort is a lot easier to deal with when we use linked structures so I’ll stay away from an array based implementation.
7
Merge Sort Ideas Split: cut the array in half. How do we do this? Merge: turn two sorted array segments into one – how do we do this? What is the complexity of split? of merge? Of mergesort? What other properties will Mergesort have?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.