{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture10

# Lecture10 - Algorithms in Systems Engineering IE170 Lecture...

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

Algorithms in Systems Engineering IE170 Lecture 10 Dr. Ted Ralphs

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

View Full Document
IE170 Lecture 10 1 References for Today’s Lecture Required reading CLRS Chapter 12 References D.E. Knuth, The Art of Computer Programming, Volume 3: Sorting and Searching (Third Edition), 1998. R. Sedgewick, Algorithms in C++ (Third Edition), 1998.
IE170 Lecture 10 2 Selection Recall that the selection problem is that of finding the k th element in an ordered list. Selection can be done using an algorithm similar to the quicksort algorithm from Lab 2 (notice the connection again). However, we need an additional data member count in the node class that tracks the size of the subtree rooted at each node. With this additional data member, we can recursively search for the k th element. Starting at the root, if the size of the left subtree is k - 1 , return a pointer to the root. If the size of the left subtree is more than k - 1 , recursively search for the k th element of the left subtree.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 8

Lecture10 - Algorithms in Systems Engineering IE170 Lecture...

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

View Full Document
Ask a homework question - tutors are online