09b.LCS slides

09b.LCS slides - List Applications Simulations Longest...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: List Applications: Simulations Longest Common Subsequence CS 103B Stanford University Spring 2008 April 25th, 2008 Outline Table of Contents Outline 1 List Refresher Refresher Special Lists 2 Longest Common Subsequence Overview Algorithm CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 2 / 14 List Refresher Refresher List Data Structure Very common data structure. Ordered (finite) sequence of elements. “Head”: first element; “tail”: the rest of the list. CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 3 / 14 List Refresher Refresher List Data Structure Very common data structure. Ordered (finite) sequence of elements. “Head”: first element; “tail”: the rest of the list. Recursive definition: A list is: I an item; or I an item followed by a list. CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 3 / 14 List Refresher Implementation Implementing Lists Several implementation choices: CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 4 / 14 List Refresher Implementation Implementing Lists Several implementation choices: 1 Array. I Advantages? I Disadvantages? CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 4 / 14 List Refresher Implementation Implementing Lists Several implementation choices: 1 Array. I Advantages? I Disadvantages? 2 Linked list. I Advantages? I Disadvantages? CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 4 / 14 List Refresher Implementation Implementing Lists Several implementation choices: 1 Array. I Advantages? I Disadvantages? 2 Linked list. I Advantages? I Disadvantages? 3 . . . ? CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 4 / 14 List Refresher Implementation Implementing Lists Several implementation choices: 1 Array. I Advantages? I Disadvantages? 2 Linked list. I Advantages? I Disadvantages? 3 . . . ? 4 Implementation 6 = abstraction. CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 4 / 14 List Refresher Special Lists Special Lists All lists are ordered sequences. Some distinctions based on how we operate on the lists: 1 Stack. 2 Queue. CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 5 / 14 List Refresher Special Lists Stacks Applications: Machine memory layout. CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 6 / 14 List Refresher Special Lists Stacks Applications: Machine memory layout. Remaining tasks. (LIFO) CS 103B (Stanford, Spring 2008) Lists: Simulations, LCS April 25th, 2008 6 / 14 List Refresher Special Lists Stacks Applications: Machine memory layout....
View Full Document

This note was uploaded on 10/01/2011 for the course CS 103B taught by Professor Sahami,m during the Winter '08 term at Stanford.

Page1 / 38

09b.LCS slides - List Applications Simulations Longest...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online