1 i206: Lecture 17: Exam 2 Prep ; Intro to Regular Expressions Marti Hearst Spring 2012.

Slides:



Advertisements
Similar presentations
Lecture 22, Revision 1 Lecture notes Java code – CodeFromLectures folder* Example class sheets – 4 of these plus solutions Extra examples (quicksort) Lab.
Advertisements

Computer Science 112 Fundamentals of Programming II Overview of Collections.
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
Week 5 - Associative Containers: sets and maps. 2 2 Main Index Main Index Content s Content s Container Types Sequence Containers Adapter Containers Associative.
Data Structures Data Structures Topic #13. Today’s Agenda Sorting Algorithms: Recursive –mergesort –quicksort As we learn about each sorting algorithm,
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 18: Hash Tables.
DictionaryADT and Trees. Overview What is the DictionaryADT? What are trees? Implementing DictionaryADT with binary trees Balanced trees DictionaryADT.
Binary Search Trees CIS 606 Spring Search trees Data structures that support many dynamic-set operations. – Can be used as both a dictionary and.
1 Foundations of Software Design Lecture 1: Course Overview Intro to Binary and Boolean Marti Hearst SIMS, University of California at Berkeley.
Rossella Lau Lecture 1, DCO20105, Semester A, DCO Data structures and algorithms  Lecture 1: Introduction What this course is about:  Data.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Cpt S 223 – Advanced Data Structures Course Review Midterm Exam # 2
The Design and Analysis of Algorithms
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Java Collections An Introduction to Abstract Data Types, Data Structures, and Algorithms David A Watt and Deryck F Brown © 2001, D.A. Watt and D.F. Brown.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Spring 2010CS 2251 Trees Chapter 6. Spring 2010CS 2252 Chapter Objectives Learn to use a tree to represent a hierarchical organization of information.
Week 6 - Friday.  What did we talk about last time?  Recursive running time  Fast exponentiation  Merge sort  Introduced the Master theorem.
CMSC 2021 CMSC 202 Computer Science II for Majors Fall 2002 Mr. Frey (0101 – 0104) Mr. Raouf (0201 – 0204)
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Built-in Data Structures in Python An Introduction.
MA/CSSE 473 Day 28 Dynamic Programming Binomial Coefficients Warshall's algorithm Student questions?
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Week 8 - Monday.  What did we talk about last time?  BST traversals  Get range implementation.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
CSS446 Spring 2014 Nan Wang.  to study trees and binary trees  to understand how binary search trees can implement sets  to learn how red-black trees.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2002 Sections Ms. Susan Mitchell.
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2003 Mr. Frey (0101 – 0104) Mr. Raouf (0201 – 0204)
1 Data Structures CSCI 132, Spring 2014 Lecture 1 Big Ideas in Data Structures Course website:
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 6: Ordered Data Abstractions
Data Structures and Algorithms in Java AlaaEddin 2012.
COMP 103 wrapping up and some exam tips 2015-T2 Lecture 32 Marcus Frean School of Engineering and Computer Science, Victoria University of Wellington 
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
CSC 143T 1 CSC 143 Highlights of Tables and Hashing [Chapter 11 p (Tables)] [Chapter 12 p (Hashing)]
MA/CSSE 473 Day 05 Factors and Primes Recursive division algorithm.
CSC317 Selection problem q p r Randomized‐Select(A,p,r,i)
Design & Analysis of Algorithm Hashing
COMP9024: Data Structures and Algorithms
Course Developer/Writer: A. J. Ikuomola
Fundamentals of Programming II Overview of Collections
MA/CSSE 473 Day 05 Factors and Primes Recursive division algorithm.
The Design and Analysis of Algorithms
COMP 53 – Week Eleven Hashtables.
An Iterative FFT We rewrite the loop to calculate nkyk[1] once
Midterm Review.
Exam Hints.
Data Structures Data Structure is a way of collecting and organising data in such a way that we can perform operations on these data in an effective.
Week 11 - Friday CS221.
Hashing Exercises.
Teach A level Computing: Algorithms and Data Structures
FINAL EXAM INFORMATION
FINAL EXAM INFORMATION
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
Binary Search Trees < > =
ITEC 2620M Introduction to Data Structures
CSE 214 – Computer Science II B-Trees
Binary Trees: Motivation
Sorted Linked List A linked list is a data structure that consists of a sequence of data records such that in each record there is a field that contains.
EN Software Carpentry Python – A Crash Course Data Structures.
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
Data Structures Using C++ 2E
CSE 326: Data Structures Lecture #14
Week 6 - Monday CS221.
Presentation transcript:

1 i206: Lecture 17: Exam 2 Prep ; Intro to Regular Expressions Marti Hearst Spring 2012

2 Preparing for Exam 2 Make a table or some other representation showing: –Each data structure we’ve covered –Its running time for insertion, deletion, searching for an item, searching for a range of items, traversing or visiting all items. –What that data structure is or is not good for. –What its major algorithms are.

3 Topics for Exam 2 Data structures: –(See previous slide for what to know) For inserting/deleting/traversing you only need to know the ones we did in detail in class You do need to know their main properties and what they are or are not useful for –When/how to apply them to different problems Python and pseudo code –Be able to understand and modify code similar to what we’ve seen. Lists, queues, sets, stacks, hash tables, trees. –Be able to create your own code or pseudo code for stated problems. The following slides show samples.

4 Choosing Data Structures Questions to think about: –Is the data static, or does it change a lot? –Does the data need to be sorted? Do you need the range of values? Or always the largest (smallest)? –Accessing data via specific values or ranges of values? –What kind of data? How large is each item? How many items? –How much memory is available? Streaming algorithms –Using distributed / parallel processing?

5 Algorithm / Data Structure Practice Say you are designing a map program. It has a huge number of points representing geographic location positions, where those points are entered once and don’t change often. What data structure and algorithm(s) would you use to compute the number of points that are within distance D of a given point? Show pseudo code to implement this.

6 Algorithm / Data Structure Practice Assume you have a large set of data, say 1,000,000 elements. Each data element has a unique string associated with it. What data structure has the optimal algorithmic access time to any element when the only thing you know about the element is the string associated with it? Show pseudo code to implement this.

7 Algorithm / Data Structure Practice Say you want to design a program to represent a textbook. The book is subdivided into parts, chapter, sections, and paragraphs. How might you want your program to access the content of this book? What data structure(s) and algorithm(s) would you use to support this? Show pseudo code to implement this.

8 Algorithm / Data Structure Practice Name a problem for which a binary search tree would be useful, but not a plain binary tree. Name a problem for which a B+tree would be useful.

9 Algorithm / Data Structure Practice Often for a given major, a student has to take some required courses. Some of those courses also have required prerequisites. How would you represent these courses so you can devise an algorithm to find a sequence of courses that allows the student to graduate? What is that sequence? A specific example: –Judy wants to take i15, i16, i22, i31, i32, i126, i127, i141, and i169. Prerequisites are: i15: none i16: i15 i22: none i31: i15 i32: i16, i31 I126: i22, i32 I127: i16 I141: i22, i16 I169: i32

10 Algorithm / Coding Practice Write a recursive algorithm to compute the product of two numbers (m*n) using only addition. Write a python program to perform Boolean operations on three sets of data.

11 Algorithm / Coding Practice Use a list comprehension to multiple the elements of two lists x and y together (multiply the first by the first, second by second, etc), yielding a list. Use a list comprehension to make a set of possible pairs from the elements of two lists x and y.