# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

17 Pages

### Handout 10

Course: CS 103B, Winter 2008
School: Stanford
Rating:

Word Count: 5525

#### Document Preview

Sahami Mehran CS103B Handout #10 January 23, 2009 Analysis of Algorithms: The Recursive Case We again thank Maggie Johnson for portions of this handout. Up until now, we have been analyzing non-recursive algorithms, looking at how big-Oh notation may be used to characterize the growth rate of running times for various algorithms. Such algorithm analysis becomes a bit more complicated when we turn our attention...

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> Stanford >> CS 103B

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Stanford - CS - 103B
Mehran Sahami CS103BHandout #11 January 23, 2009Analyzing Searching and SortingIn examining methods to analyze both recursive and non-recursive algorithms, it is only fitting to spend a little time looking at a variety of common algorithms and their co
Stanford - CS - 103B
Mehran Sahami CS103BHandout #12 January 23, 2009Problem Set #2 Due: 11:00am on Monday, February 2nd1. Let R be a relation on the set cfw_1, 2, 3, 4, 5 containing the ordered pairs: cfw_&lt;1,1&gt;,&lt;1,2&gt;,&lt;1,3&gt;,&lt;2,3&gt;,&lt;2,4&gt;,&lt;3,1&gt;,&lt;3,4&gt;,&lt;3,5&gt;,&lt;4,2&gt;,&lt;4,5&gt;,&lt;5,1&gt;,&lt;
Stanford - CS - 103B
Mehran Sahami CS103BHandout #13 January 28, 2009Managing a Bestiary of Algorithms: Complexity Classes and NP-CompletenessThanks to Maggie Johnson for some portions of this handout.A Quick Introduction to NP-CompletenessImagine that you have decided t
Stanford - CS - 103B
Mehran Sahami CS103BHandout #16 February 2, 2009Problem Set #3 Due: 11:00am on Wednesday, February 11thNote: in the problems below in which you are asked for a big-Oh running time, we are looking for a tight big-Oh bound (analogous to the big-Theta ()
Stanford - CS - 103B
Mehran Sahami CS103BHandout #17 February 2, 2009Introduction to TreesHierarchical StructuresTrees are very useful conceptual tools for representing relationships among certain classes of items. For example, trees can be used to represent familial rela
Stanford - CS - 103B
Mehran Sahami CS103BHandout #19 February 6, 2009Practice Midterm ProblemsNote: the number of problems here is a larger than you will see on the actual midterm. More problems are provided here just to give you a bit more practice on a broader set of the
Stanford - CS - 103B
Mehran Sahami CS103BHandout #20 February 6, 2009Practice Midterm Problem Solutions(including some hints and shortcuts you might find useful for exams) 1. Order in which nodes are processed if we were to do a reverse preorder traversal on the tree: a, c
Stanford - CS - 106B
CS106B Winter 2009Handout 01CS106B Course InformationJerry Cainjerry@cs.stanford.eduJanuary 7th, 2009Instructor: E-Mail: Office phone: Office: Office hours: Lectures:725-8597 Gates 192 Wednesdays, 10:00 a.m. noon MWF 9:00 9:50 a.m. Gates Building,
Stanford - CS - 106B
CS106B Winter 2009Handout 02Early Programming: Landmarks and LandminesJanuary 7th, 2009Handout written by Julie Zelenski, Mehran Sahami, and Robert Plummer.After todays lecture, you should run home read all of Chapter 1 on your own. We won't teach th
Stanford - CS - 106B
CS106B Winter 2009Handout 03Two-Dimensional Grids and Queen SafetyJanuary 9, 2008This handout was written by Jerry.Today's larger example demonstrates the use of a grid of Boolean valuesthat is, a single declaration of a Grid&lt;bool&gt;to maintain informa
Stanford - CS - 106B
CS106B Winter 2009Handout 04C+ StringsJanuary 12, 2009Original handout written by Neal Kanodia, with help from Steve Jacobson.C+ Strings One of the most useful data types supplied in the C+ libraries is the string. A string is a variable that stores
Stanford - CS - 106B
CS106B Winter 2009Handout 05Crash Course: Records and FilesJanuary 12, 2009Your task is to design a data structure to keep track of the academic departments on campus. There are an unbounded numbers of departments, and each department has a name and a
Stanford - CS - 106B
CS106B Winter 2009Handout 06Assignment 1: Blocky!January 12, 2009Brand- new assignment!Your first assignment has you implement variation on a one-player game called Blocky. The rules are simple: click any single block and drag the mouse to outline a
Stanford - CS - 106B
CS106B Winter 2009Handout 07Good Programming StyleJanuary 14, 2009Thanks to Julie Zelenski, Nick Parlante, and Bob Plummer for this handout.As we will stress all quarter, a working program is only half the challengeconstructing an elegant and well-en
Stanford - CS - 106B
CS106B Winter 2009Handout 08DecompositionJanuary 14th, 2009Due to Nick Parlante.Decomposition is the process of breaking a large problem into more manageable subproblems. The motivating principle is that large problems are disproportionately harder t
Stanford - CS - 106B
CS106B Winter 2009Handout 09Coding StandardsJanuary 14th, 2009Handout written by Nick Parlante. Quite possibly the funniest handout ever.Landmarks in Coding Quality Let's honestly review the conceptual landmarks most programmers use when thinking abo
Stanford - CS - 106B
CS106B Winter 2009Handout 10C+ and CS106 Library ReferenceJanuary 14, 2009Written by Julie Zelenski.You're sitting at your computer, trying to write some code that manipulates a string or stream or draws some graphics. You know the functionality you
Stanford - CS - 106B
CS106B Winter 2009Handout 11Section Handout 1January 14, 2009Problem 1: Compiler, compiler, what do you want? You are working hard on your latest assignment and come up with the following code:enum directionT cfw_ North, East, South, West ; int main(
Stanford - CS - 106B
CS106B Winter 2009Handout 11SSection Solution 1January 14 - 16, 2009Problem 1: Compiler, compiler, what do you want? The line that will not compile in this example is the line that performs the assignment dir = num;. Why not? Enumerated types are repr
Stanford - CS - 106B
CS106B Winter 2009Handout 12MDebugging with XCodeJanuary 16, 2009Many thanks to Justin2, Jason, and Julie for portions of this handout.Using the Xcode debugger Note: this handout refers to Xcode 2.5. The windows for Xcode 3.1 will look slightly diffe
Stanford - CS - 106B
CS106B Winter 2008Handout 13CS106 Library ClassesJanuary 16, 2008Kudos to Julie Zelenski for this fantastic summary of the CS106 utility and container classes.This summer Im going to try something that another lecturer successfully tried last quarter
Stanford - CS - 106B
CS106B Winter 2009Handout 14Electronic SubmissionJanuary 17, 2009This handout was written by Mehran Sahami and updated by Nick Miyake and Jerry Cain.Submission procedures When you submit a completed assignment, you will turn it two versions, a paper
Stanford - CS - 106B
CS106B Winter 2009Handout 15Section Handout 2January 21, 2009Problem 1: Using the Scanner and Stack classes&lt;html&gt;&lt;b&gt;&lt;i&gt;CS106 rules!&lt;/i&gt;&lt;/b&gt;&lt;/html&gt;Web browsers use stacks to track html tags such as &lt;b&gt;, &lt;i&gt; or &lt;html&gt;. Every html tag must be matched b
Stanford - CS - 106B
CS106B Winter 2009Handout 15SSection Solution 2January 21 22, 2009Problem 1: Using the Scanner and Stack classes#include &quot;stack.h&quot; #include &quot;scanner.h&quot; bool ProcessOpenTag(Scanner&amp; scanner, Stack&lt;string&gt;&amp; tagStack) cfw_ string tag = scanner.nextToken
Stanford - CS - 106B
CS106B Winter 2009Handout 17CS106 Library Classes: Take IIJanuary 21, 2009Kudos to Julie Zelenski for this fantastic summary of the CS106 utility and container classes.More on Map Last handout, we noted that the map assumes that keys are of string ty
Stanford - CS - 106B
CS106B Winter 2009Handout 18Introduction to RecursionJanuary 28, 2009Today we'll start working with one of CS106Bs neatest ideas: recursion. Recursion often does the trick whenever the problem to be solved can be broken down into virtually identical (
Stanford - CS - 106B
CS106B Winter 2009Handout 19Section Handout 3January 28, 2009Problem 1: Presidential Speech Tag Cloud Youre handed a Vector&lt;Map&lt;int&gt; &gt; of length 209. The kth item in this Vector is a Map&lt;int&gt; which stores the number of times a nontrivial word appeared
Stanford - CS - 106B
CS106B Winter 2009Handout 19SSection Solution 3January 28 - 30, 2009Solution 1: US Presidential Speech Tag Cloud You may have seen of the web site that inspired this problem. If not, check outhttp:/chir.ag/phernalia/preztags/.This problem was intend
Stanford - CS - 106B
CS106B Winter 2009Handout 20Assignment 3: Recursion Problem SetJanuary 30, 2009This week your task is structured as a problem set, consisting of several small problems to solve in isolation. Recursion is a difficult concept to master and one that is w
Stanford - CS - 106B
CS106B Winter 2009Handout 21Section Handout 4February 4, 2009Problem 1: Towers Of Hanoi Revisited One of the first procedural recursion problems we discussed in lecture was the classic Towers Of Hanoi problem. The recursive solution lists a series of
Stanford - CS - 106B
CS106B Winter 2009Handout 23CS106B Practice MidtermFebruary 6th, 2009Exam Facts: When: Wednesday, February 11th at 7:00 p.m. Where: TBD (probably Dinkelspiel Auditorium, but still waiting for confirmation) Coverage The midterm will test everything up
Stanford - CS - 106B
CS106B Autumn 2009Handout 23SCS106B Practice SolutionFebruary 6th, 2009Solution 1: Acronymsvoid ReadIntoMap(ifstream&amp; in, Map&lt;Vector&lt;string&gt; &gt;&amp; map) cfw_ Scanner s; s.setSpaceOption(Scanner:IgnoreSpaces); while (true) cfw_ string line; getline(in, li
Stanford - CS - 106B
CS106B Winter 2009Handout 29Section Handout 6February 18, 2009Problem 1: Removing Duplicates Write a function RemoveDuplicates that given a linked list will remove and free the second of all neighboring duplicates found in the list. If the incoming li
Stanford - CS - 106B
CS106B Winter 2009Handout 29SSection Solution 6February 18-20, 2009Problem 1: Removing Duplicatesvoid RemoveDuplicates(node *list) cfw_ for (node *cur = list; cur != NULL; cur = if (cur-&gt;next != NULL &amp; cur-&gt;value = node *duplicate = cur-&gt;next; cur-&gt;n
Old Dominion - ENGLISH - 12
www.GetPedia.com*More than 150,000 articles in the search database *Learn how almost everything worksEnglish Vocabulary in UseCAMBRIDGEU NIVERSITY PRESSPUBLISHED BY T H E PRESS SYNDICATE O F T H E UNIVERSITY OF CAMBRIDGET he Pitt Building, Trumpingt
Old Dominion - ENGLISH - 15
New New Headway Intermediate Testsea e a ho TeachHea tocopi lass o p da ar omfe un l, stndt a s ho iada o p da ar somfe un l, stndt a C mater tte.tion i riadati is a e c mate tte. on Casstaught an e co short staught anduexplained thoroughly, Cas rse zer
Golden West - BIOL 200 - BIOL 200
Summer 2009 Bio 200Pharmacology: An Introduction to Basic Drug GroupsCourse Objective Students will study the classication of medications and basic principles of pharmacology from legislation and pharmacokinetics through receptor theory, pharmacodynamic
Golden West - BIOL 200 - BIOL 200
DrugsofthePeripheralNervousSystemNervousSystems2DivisionsCentralBrain SpinalCordPeripheralVoluntary Involuntary AutonomicSympathetic ParasympatheticEffectorCellsofthe PeripheralNervousSystemVoluntarySkeletalMuscleAutonomicCardiacMuscle SmoothMu
Golden West - BIOL 200 - BIOL 200
Unit 10Serums, Vaccines &amp; HormonesTypes of ImmunityNatural (Inborn) ActiveMake Own AntibodiesAcquiredPassiveGiven Preformed AntibodiesExposureInjection Vaccine ToxoidMother to FetusSerums(Gamma Globulins)Diabetes Mellitus Characterized by el
Golden West - BIOL 200 - BIOL 200
Unit 9DiureticsFiltrationReabsorption Secretion ExcretionDCT: Aldosterone PCT: 100% Nutrients Reabsorbed`Clor HCO3-K+ o r H +Powerful Reabsorption: Cl- &amp; Na+Collecting Tubule: Loop of Henle:Counter Current Mechanism Sets up ability to concentrat
Golden West - BIOL 200 - BIOL 200
Unit 8Eye, Skin &amp; AntimicrobialsWide Angle1Narrow AngleThree major types of glaucoma and basic treatment: Congenital Glaucoma surgery required Primary Glaucoma Narrow angle (also called acute congestive) cause: poor drainage because of position of
Golden West - BIOL 200 - BIOL 200
Unit 7Respiratory, Antihistaminic &amp; GI DrugsAsthma: Bronchoconstriction Increased mucus productionManaging the Airway Drugs to open the airway Drugs to treat the inflammation Decrease the airway remodeling Remodeling describes the permanent, negativ
Golden West - BIOL 200 - BIOL 200
Drugs of the Central Nerous SystemStimulation Increases: Convulsions or Seizures Sensory Acuity Motor Activity Tremors &amp; Hallucinations Anxiety Euphoria Normal -Neutral Sedation (Drowsy) Hypnosis (Sleep) General Anesthesia Coma DeathDeathDepression Inh
Golden West - BIOL 200 - BIOL 200
Unit 5Drugs of the Cardiovascular SystemCardiotonic drugs Drugs that increase the strength of the heart. Drugs for a failing heart.The heart becomes weaker as a pump. Can happen over many years or rapidly in response to injury Goals for treatment: in
Golden West - BIOL 200 - BIOL 200
Lecture 2How effective is the drug at producing a pharmacologic response. How well does it relief symptoms Not concerned with how much a person needs totake to get the effectMaximum effect of the drugThe amount of the drug necessary to produce a phar
Golden West - BIOL 200 - BIOL 200
Welcome to Pharmacolgy Biology 200Petitioners will be added at the end of lectureDr. Kate EganOffice: HS 115 Phone: 714.892.7711 ext. 51125 Hours: Tuesday 2:15-3:15 / 5:30-6:30 PM Wednesday 6:00 - 7:00 PM or by appointment Email: cegan@gwc.cccd.edu Cou
Golden West - BIOL 200 - BIOL 200
PHARMACOLOGY: Homework AssignmentDue: Worth: Time:PRINT NAME:_ Three ID#:_Last Class Meeting Before Final Exam - Will not be accepted late. 5 points Do not spend more than 30 minutesUSE: DRUG FACTS AND COMPARISONS1. Use the Table of Contents of Drug
Golden West - BIOL 200 - BIOL 200
PRINT NAME: _ ID#:_ PHARMACOLOGY: HOMEWORK 2 Due: Meeting When Beginning Unit 7 - Will not be accepted late. Worth: 5 points Time: Do not spend more than 30 minutesUSE: DRUG FACTS AND COMPARISONS1. Use the Table of Contents from the front of Drug Facts
Golden West - BIOL 200 - BIOL 200
Print Name:_ Student ID #:_ Pharmacology: Homework Assignment One Due: March 4, 2009 5 pts Look up a drug of your choice in 3 a Physicians Desk Reference Book, a Drug Facts &amp; Comparisons Book and another drug reference book of your choice. Goal of the ass
Golden West - BIOL 200 - BIOL 200
Pharmacology Final Study OutlineUnit 1-3 (8) Understand Ionization and how it pertains to the movement of a drug Know the difference between potency and efficacy Review Drug Schedule/ prescription writing procedures How are drugs namedtrade names, generi
Golden West - BIOL 200 - BIOL 200
Name:_ ID #:_ Bio 200- Pharmacology Additional Extra Credit Assignment Due 5/20 NO LATE ASSIGNMENTS WILL BE ACCEPTED Write on this sheet of paper (you can use both sides if needed) Research the mechanism of action of the diuretics furosemide (Lasix) and s
Golden West - BIOL 200 - BIOL 200
Pharmacology Extra Credit AssignmentWorth 5 points Due Meeting Before Final Exam Accepted Earlier but not laterAssignment:1. Read one article in a professional journal which has been published within the past 15 months. This includes major science maga
Golden West - BIOL 200 - BIOL 200
Pharmacology Exam 3 Review (Units 6-8) Unit 6 Drugs of the CNS Memorize the Continum Chart Understand the 2 types of tolerance Factors contributing to drug dependence CNS Stimulants how do they work? What are the main types we talked about in class the ma
Golden West - BIOL 200 - BIOL 200
EXAM 2 REVIEW Unit 4 Drugs of the Peripheral Nervous System What are preganglionic and postganglionic neurons and where are they found? How many efferent neurons in the SNS, PNS, voluntary portion of the nervous system What are the main receptors we talke
Golden West - BIOL 200 - BIOL 200
Outline of Central Nervous System DrugsDirections: MEMORIZE THIS A. CNS Stimulants - increase activity of ALL parts of the CNS 1. Amphetamines and related compounds 2. Xanthines (including caffeine, theobromine, and theophylline) 3. Cocaine and related l
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 13 Convergence analysis of the barrier method complexity analysis of the barrier method convergence analysis of Newtons method choice of update parameter bound on the total number of Newton iterations initialization131Comp
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 14 Primal-dual interior-point methods primal-dual path-following Mehrotras corrector step computing the search directions141Central path and complementary slacknesss + Ax b = 0 AT z + c = 0 zisi = 1/t, z 0, i = 1, . . . ,
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 15 Self-dual formulations initialization and infeasibility detection skew-symmetric LPs homogeneous self-dual formulation self-dual formulation151Solution of an LPgiven a pair of primal and dual LPs minimize cT x subject
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 16 Large-scale linear programming cutting-plane method Benders decomposition delayed column generation Dantzig-Wolfe decomposition161Cutting-plane methodminimize cT x subject to Ax b A Rmn, m n general idea: solve sequenc
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 17 Integer linear programming integer linear programming, 0-1 linear programming a few basic facts branch-and-bound171Denitioninteger linear program (ILP) minimize cT x subject to Ax b, x ZncGx = dmixed integer linear
Monmouth IL - CAAM - 236
EE236A (Fall 2007-08)Lecture 1 Introduction and overview linear programming example from optimal control example from combinatorial optimization history course topics software11Linear program (LP)nminimizej =1 ncj xj aij xj bi,j =1 nsubject toi