Lecture5 - Algorithms in Systems Engineering IE170 Lecture...

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

View Full Document Right Arrow Icon
Algorithms in Systems Engineering IE170 Lecture 5 Dr. Ted Ralphs
Background image of page 1

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

View Full DocumentRight Arrow Icon
IE170 Lecture 5 1 References for Today’s Lecture Required reading CLRS Chapter 2 References R. Sedgewick, Algorithms in C++ (Third Edition), 1998.
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
IE170 Lecture 5 4 Implementing Merge Sort Here is the subroutine for implementing a basic merge sort. To sort an entire array the call would be
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/29/2008 for the course IE 170 taught by Professor Ralphs during the Spring '07 term at Lehigh University .

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 Right Arrow Icon
Ask a homework question - tutors are online