Algorithms_and_Data_Structures_08a

# Algorithms_and_Data_Structures_08a - Lecture 8 Computer...

This preview shows pages 1–13. Sign up to view the full content.

Computer Science Algorithms and Data Structures Prof. Dr. Andreas Nüchter Research I, Room 105 Jacobs University Bremen http://www.nuechti.de andreas@nuechti.de Lecture 8

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 232 Announcements Midterm October 15 9.45-11.00 in class Remember grading policy: Assignments: 20% of the final grade Midterm: 30% of the final grade Final exam: 50% of the final grade Midterm has 3 parts: 1. Applying discussed algorithms to problems 2. Solving problems similar to homework 3. Solving new problems October 8 review and discussion session
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 233 Last Lecture – Quicksort • Idea: divide divide divide

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 234 Last Lecture – Quicksort • Idea: • Main function: // pivot element // elements less than the pivot // elements greater than the pivot
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 235 Last Lecture – Quicksort One implementation of the Partition function Iteration over the array from left to right using two indices •N o t e : This is based on the Cormen at al. book! // pivot element

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 236 Last Lecture – Quicksort An example, more on assignment #6.
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 237 Lower Bounds for Sorting Precondition : For sorting only key comparisons are allowed. Next, we aim at proving the following theorem. Theorem : The average number of comparisons for sorting keys is

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 238 Lower Bounds for Sorting Example : Consider the following sorting problem with 3 keys. yes yes yes yes yes no no no no no
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 239 Lower Bounds for Sorting Average runtime = average path length Given a binary decision tree , i.e., a tree with root and all nodes have less or equal 2 out edges. Semantic : At the nodes comparisons are per- formed.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 240 Lower Bounds for Sorting An optimal decision tree has two child nodes for a comparison node, thus we extend the definition: To the extended binary decision tree is that is defined as leaves of where inner nodes of and every inner node has two child nodes. In other words: To every node of with degree < 2 child nodes are attached, such that has out-degree 2.
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 241 Lower Bounds for Sorting Semantic : At the leaves of the tree there are the permutations that correspond to the sortings.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms and Data Structures Dr. Andreas Nüchter September 29, 2009 242 Lower Bounds for Sorting Lemma : In other words: In there exists exactly one leave more than inner nodes.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/04/2010 for the course CS 320251 taught by Professor Nuechter during the Fall '09 term at Jacobs University Bremen.

### Page1 / 52

Algorithms_and_Data_Structures_08a - Lecture 8 Computer...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online