{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture5

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

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

Algorithms in Systems Engineering IE170 Lecture 5 Dr. Ted Ralphs

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

View Full Document
IE170 Lecture 5 1 References for Today’s Lecture Required reading CLRS Chapter 2 References R. Sedgewick, Algorithms in C++ (Third Edition), 1998.
IE170 Lecture 5 2 Recursion A recursive function is one that calls itself. There are two basic types of recursive functions. A linear recursion calls itself once. A branching recursion calls itself two or more times. Examples of linear recursion

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

View Full Document
IE170 Lecture 5 3 Divide and Conquer Many common problems can be solved using a divide-and-conquer approach. This means breaking a larger problem into pieces that can be solved independently. The solutions to the various pieces may then have to recombined in some way. Divide-and-conquer algorithms have natural implementations using branching recursions. Example : Merge sort
IE170 Lecture 5 4 Implementing Merge Sort Here is the subroutine for implementing a basic merge sort.

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 / 9

Lecture5 - Algorithms in Systems Engineering IE170 Lecture...

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

View Full Document
Ask a homework question - tutors are online