We aren't endorsed by this school
##### CS 106 - Stanford Study Resources
• 3 Pages
###### 11-DesigningClasses

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #11 January 16, 2015 Designing Classes Optional Movie Classes and Objects Eric Roberts CS 106B January 16, 2015 Outline 1. Anagram exercise from last time 2. Structures 3. Representing points using a structure 4. Classes and o

• 3 Pages
###### 03-HonorCode

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #3 January 5, 2015 Computer Science and the Stanford Honor Code Since 1921, academic conduct for students at Stanford has been governed by the Honor Code, which reads as follows: THE STANFORD UNIVERSITY HONOR CODE A. The Honor

• 2 Pages
###### Section #1 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Section 1 Solutions (Week 2) 1. Passing Parameters. Original XehranM Cynthia Changed to cs(b, a); XehranM Marty Changed to a = cs(b, a); (Even though the second parameter gets changed by reference, it is then assigned the return value of the functi

• 9 Pages
###### Practice Midterm #6

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #6 (based on CS 106B Summer 2014 midterm) This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions

• 10 Pages
###### Practice Midterm #5

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #5 (based on CS 106B Winter 2014 midterm) This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions

• 3 Pages
• ###### Practice Midterm #6 Solutions
• Register Now
###### Practice Midterm #6 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #6 ANSWER KEY 1. C+ Basics / Parameters (read) dx cx 21 2 cxx zx 301 22 zxx cxx 2 302 2 21 301 cxx zxx zx 2. File I/O and Strings (write) int printMostCommonName(ifstream& input) cfw_ int uniqueNames = 1; / counters for names

• 10 Pages
###### Practice Midterm #4

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #4 (based on CS 106B Autumn 2013 midterm) This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions

• 7 Pages
• ###### Practice Midterm #5 Solutions
• Register Now
###### Practice Midterm #5 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #5 ANSWER KEY 1. C+ Basics / Parameters 4 0xdd00 7 12 6 0xff00 9 15 8 0xbb00 11 17 17 15 9 11 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here are two: / short-n-sweet so

• 4 Pages
• ###### Practice Midterm #4 Solutions
• Register Now
###### Practice Midterm #4 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #4 ANSWER KEY 1. C+ Basics / Parameters -6 1 5 12 -4 1 4 5 8 2 5 -4 9 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void inputStats(string filename) cfw_ ifstr

• 10 Pages
###### Practice Midterm #3

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #3 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions in this sample exam will match the num

• 4 Pages
###### 01-CoursePlacement

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #1 January 5, 2015 Course Placement Information With extensive updates by Keith Schwarz and Mehran Sahami. CS 106A, CS 106B, CS 106L, CS 106X, CS 107, CS 101, CS 105, CS 107E, CS 142 there are a lot of programming classes to c

• 6 Pages
###### 02-CourseInformation

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #2 January 5, 2015 CS 106B General Information Professor: Eric Roberts E-mail: eroberts@cs.stanford.edu Offices: Gates 202 Phone: 723-3642 Drop-in hours: Tuesdays, 9:3011:30 A.M. Wednesdays after class in Bytes Caf TA: Kevin M

• 3 Pages
###### 08-CollectionClasses1

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #8 January 12, 2015 Collection Classes (Part 1) Outline Collection Classes 1. Introduce the idea of collection classes (Part 1: Vectors, Grids, Stacks, and Queues) 2. Introduce the Vector class 3. Use vectors to read an entire

• 9 Pages
###### 12-Assignment2

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #12 January 16, 2015 Assignment #2Using ADTs The idea for Random Writer comes from Joe Zachary at the University of Utah. Parts of this handout were written by Julie Zelenski and Jerry Cain. Due: Monday, January 26 Now that yo

• 3 Pages
###### 13-RandomWriterContest

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #13 January 16, 2015 The CS106B Random Writer Contest Due date: Friday, January 30 On Assignment #2, the second problem has you create a random-writer application that uses a Markov model to generate English text according to

• 2 Pages
###### 09A-Section1Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #9A January 12, 2015 Solutions to Section Handout #1 Problem 1. String manipulation There are several possible strategies for implementing the character-removal problem. The implementations shown below go through the text strin

• 2 Pages
• ###### 07-SubmittingAssignments
• Register Now
###### 07-SubmittingAssignments

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #7 January 9, 2015 Submitting Assignments This handout was written by Jeremy Keeshin. This quarter, you will be submitting your assignments with Paperless, which is a tool that will let section leaders comment on your code wit

• 4 Pages
###### 06-StringsAndStreams

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #6 January 9, 2015 Strings and Streams Administrative Reminders Strings and Streams All handouts and course information are on the web site: http:/cs106b.stanford.edu/ All CS 106B students must sign up for a section by Sunda

• 2 Pages
###### 09-Section1

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #9 January 12, 2015 Section Handout #1Simple C+ Sections will meet once a week to give you a more intimate environment to discuss course material, work through problems, and raise any questions you have. Each week we will hand

• 3 Pages
###### 04-FunctionsInC++

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #4 January 7, 2015 Functions in C+ Administrative Essentials Functions in C+ All handouts and course information are on the web site: http:/cs106b.stanford.edu/ All CS 106B students must sign up for a section by Sunday at 5:

• 5 Pages
###### 05-Assignment1

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #5 January 7, 2015 Assignment #1Simple C+ Parts of this handout were written by Julie Zelenski. Due: Friday, January 16 Part 1. Get Qt Creator working Your first task is to set up Qt Creator, which is the programming environme

• 6 Pages
• ###### Practice Midterm #2 Winter 2013
• Register Now
###### Practice Midterm #2 Winter 2013

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #25 January 30, 2013 Practice Midterm Exam #2 Review session: Sunday, February 3, 7:009:00 P.M., Hewlett 201 (next door) Midterm #1: Tuesday, February 5, 3:155:15 P.M., Braun Auditorium (Chemistry) Midterm #2: Tuesday, February

• 4 Pages
• ###### Practice Midterm #3 Solutions
• Register Now
###### Practice Midterm #3 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #3 ANSWER KEY 1. C+ Basics / Parameters 0 2 8 8 3 7 8 7 1 8 9 2 9 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void coinFlip(string filename) cfw_ ifstream in

• 8 Pages
• ###### Practice Midterm #1 Summer 2014
• Register Now
###### Practice Midterm #1 Summer 2014

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #1 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions in this sample exam will match the num

• 4 Pages
• ###### Practice Midterm #1 Summer 2014 Solutions
• Register Now
###### Practice Midterm #1 Summer 2014 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #1 ANSWER KEY 1. C+ Basics / Parameters 9 -3 -7 9 5 -7 5 10 1 7 3 -2 -6 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void wordStats(string filename) cfw_ ifst

• 9 Pages
• ###### Practice Midterm #1 Spring 2013 Solutions
• Register Now
###### Practice Midterm #1 Spring 2013 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Spring 2013 Handout #17S May 3, 2013 CS106B Practice Midterm Exam #1 Solutions Problem One: Detecting Gerrymandering (35 Points) The simplest solution to this problem is simply to count up how many districts were won, along with the total number of

• 7 Pages
• ###### Practice Final #2 Winter 2013 Solutions
• Register Now
###### Practice Final #2 Winter 2013 Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #54A March 13, 2013 Answers to Practice Final Examination #2 Review session: Scheduled finals: Sunday, March 17, 3:005:00 P.M. (Hewlett 200) Tuesday, March 19, 12:153:15 P.M. (Hewlett 200) Thursday, March 21, 12:153:15 P.M. (He

• 5 Pages
• ###### Practice Final Fall 2012 Solutions
• Register Now
###### Practice Final Fall 2012 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Handout 40S December 4th, 2012 Autumn 2012 CS106B Practice Final Solution Solution 1: Linked Lists a. static Map<string, string> concatenateMaps(const node *maplist) cfw_ Map<string, string> concatenations; for (const node *curr = maplist; curr !=

• 7 Pages
• ###### Practice Final #1 Winter 2013 Solutions
• Register Now
###### Practice Final #1 Winter 2013 Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #52A March 11, 2013 Answers to Practice Final Examination #1 Review session: Scheduled finals: Sunday, March 17, 3:005:00 P.M. (Hewlett 200) Tuesday, March 19, 12:153:15 P.M. (Hewlett 200) Thursday, March 21, 12:153:15 P.M. (He

• 9 Pages
• ###### Practice Final Fall 2012
• Register Now
###### Practice Final Fall 2012

School: Stanford

Course: Programming Abstractions

CS106B Handout 40 December 4th, 2012 Autumn 2012 CS106B Practice Final Exam Facts: When: Where: Friday, December 14th from 12:15 3:15 p.m. Last Names A through Kh: Building 320, Room 105 Last Names Ki through Z: Building 420, Room 040 Coverage The closed

• 8 Pages
• ###### Practice Final #2 Winter 2013
• Register Now
###### Practice Final #2 Winter 2013

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #54 March 11, 2013 Practice Final Examination #2 Review session: Scheduled finals: Sunday, March 17, 3:005:00 P.M. (Hewlett 200) Tuesday, March 19, 12:153:15 P.M. (Hewlett 200) Thursday, March 21, 12:153:15 P.M. (Hewlett 200) 1

• 5 Pages
• ###### Practice Midterm #1 Solutions
• Register Now
###### Practice Midterm #1 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #1 ANSWER KEY 1. C+ Basics / Parameters 9 -3 1 -7 9 6 5 -7 2 5 9 -3 0xcc00 0xbb00 0xdd00 -7 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void wordStats(string

• 10 Pages
###### Practice Midterm #1

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #1 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions in this sample exam will match the num

• 7 Pages
• ###### Practice Midterm #1 Spring 2013
• Register Now
###### Practice Midterm #1 Spring 2013

School: Stanford

Course: Programming Abstractions

CS106B Spring 2013 Handout #14 May 1, 2013 Practice CS106B Midterm Exam This handout is intended to give you practice solving problems that are comparable in format and difficulty to the problems that will appear on the midterm examination on Tuesday, May

• 4 Pages
• ###### Practice Midterm #2 Winter 2013 Solutions
• Register Now
###### Practice Midterm #2 Winter 2013 Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #25A February 1, 2013 Answers to Practice Midterm Exam #2 Review session: Sunday, February 3, 7:009:00 P.M., Hewlett 201 (next door) Midterm #1: Tuesday, February 5, 3:155:15 P.M., Braun Auditorium (Chemistry) Midterm #2: Tuesd

• 4 Pages
• ###### Practice Midterm #1 Winter 2013 Solutions
• Register Now
###### Practice Midterm #1 Winter 2013 Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #23A January 30, 2013 Answers to Practice Midterm Exam #1 Review session: Sunday, February 3, 7:009:00 P.M., Hewlett 201 (next door) Midterm #1: Tuesday, February 5, 3:155:15 P.M., Braun Auditorium (Chemistry) Midterm #2: Tuesd

• 10 Pages
###### Practice Midterm #2

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #2 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions in this sample exam will match the num

• 8 Pages
• ###### Practice Midterm #2 Summer 2014
• Register Now
###### Practice Midterm #2 Summer 2014

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #2 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual midterm exam. We do not guarantee that the number of questions in this sample exam will match the num

• 3 Pages
• ###### Practice Midterm #2 Summer 2014 Solutions
• Register Now
###### Practice Midterm #2 Summer 2014 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #2 ANSWER KEY 1. C+ Basics / Parameters yo2 - hi1 bye2 - yo1 hi12 - bye1 hi1 bye1 yo1 !hi12 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void flipLines(string

• 7 Pages
• ###### Practice Midterm #2 Spring 2013
• Register Now
###### Practice Midterm #2 Spring 2013

School: Stanford

Course: Programming Abstractions

CS106B Spring 2013 Handout #21 May 22, 2013 Practice Second Midterm Exam _ Based on handouts by Eric Roberts and Jerry Cain This handout is intended to give you practice solving problems that are comparable in format and difficulty to the problems that wi

• 4 Pages
• ###### Practice Midterm #2 Solutions
• Register Now
###### Practice Midterm #2 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Practice Midterm Exam #2 ANSWER KEY 1. C+ Basics / Parameters yo2 - hi1 bye2 - yo1 hi12 - bye1 hi1 bye1 yo1 !hi12 2. File I/O and Strings (write) As with any programming problem, there are many correct solutions. Here is one: void flipLines(string

• 7 Pages
• ###### Practice Midterm #2 Spring 2013 Solutions
• Register Now
###### Practice Midterm #2 Spring 2013 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Spring 2013 Handout #22S May 24, 2013 Practice Second Midterm Exam Solutions _ Based on handouts by Eric Roberts and Jerry Cain Problem One: Reversing a Queue One way to reverse the queue is to keep moving nodes out of the list one at a time to the

• 6 Pages
• ###### Practice Midterm #1 Winter 2013
• Register Now
###### Practice Midterm #1 Winter 2013

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #23 January 28, 2013 Practice Midterm Exam #1 Review session: Sunday, February 3, 7:009:00 P.M., Hewlett 201 (next door) Midterm #1: Tuesday, February 5, 3:155:15 P.M., Braun Auditorium (Chemistry) Midterm #2: Tuesday, February

• 10 Pages
• ###### Practice Final #2 Summer 2014
• Register Now
###### Practice Final #2 Summer 2014

School: Stanford

Course: Programming Abstractions

CS 106B Practice Final Exam #2 This sample exam is intended to demonstrate an example of some of the kinds of problems that will be asked on the actual final exam. We do not guarantee that the number of questions in this sample exam will match the number

• 40 Pages
###### Chapter7

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! True/False Problems 1. T 2. F 3. F 4. F 5. F Multiple Choice 6. (a) 7. (a) 8. (a) Memory Snapshot Problems 5 9. t -> 8 s -> H t -> 10. a 11 name -> 14 e e S l i u 17 l o e o \0 u \0 ? ? ? ? ? ? 11. 1 12. 265 13. K265 Programming Exercises L

• 19 Pages
###### 02-FunctionsInC++

School: Stanford

Course: Programming Abstractions

Functions in C+ Eric Roberts CS 106B January 7, 2015 Administrative Essentials All handouts and course information are on the web site: http:/cs106b.stanford.edu/ All CS 106B students must sign up for a section by Sunday at 5:00P.M. The signup form will a

• 30 Pages
###### 01-Introduction

School: Stanford

Course: Programming Abstractions

Introduction to CS 106B Eric Roberts CS 106B January 5, 2015 CS 106B Staff Professor: Eric Roberts eroberts@cs.stanford.edu Office Hours (Gates 202): Tuesdays 9:30-11:30 Wednesdays after class at Bytes Head TA: Kevin Miller kmiller4@stanford.edu Office Ho

• 2 Pages

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #48A March 11, 2015 Solutions to Problem Set #2 Problem 1: Binary search trees Problem 2: Graph traversals DFS from STAN: STAN, SRI, UTAH, BBN, CMU, NRL, HARV, MIT, RAND, UCLA BFS from CMU: CMU, BBN, NRL, UTAH, MIT, HARV, RAND

• 2 Pages

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #55 March 13, 2015 Looking Ahead CS Major: Systems and Theory Core Looking Ahead Eric Roberts CS 106B March 13, 2015 Structure of the CS Major Articial Intelligence and the Turing Test In 1950, Alan Turing posed a thought exp

• 2 Pages
###### 54-FunctionsAsData

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #54 March 11, 2015 Functions as Data Iteration Strategies Functions as Data Chapter 20 of the text covers two strategies for iterating over collections: iterators and mapping functions. Kevin showed you how to use iterators

• 4 Pages
###### 53-MoreAlgorithms

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #53 March 9, 2015 More Algorithms Outline for Today More Algorithms for Trees and Graphs The plan for today is to walk through some of my favorite tree and graph algorithms, partly to demystify the many real-world application

• 3 Pages
###### 41A-Section7Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #41A February 25, 2015 Solutions to Section Handout #7 1. Coding depth-first search 2. Coding breadth-first search 3a) 3b) Lounge, Conservatory, BallRoom, BilliardRoom, Library, Hall, DiningRoom, Kitchen, Study Kitchen, BallRo

• 3 Pages
###### 38A-Section6Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #38A February 18, 2015 Solutions to Section Handout #6 1. Tracing binary tree insertion 1a. What is the height of the resulting tree? 5 1b. Which nodes are leaves? Bombur, Gloin, Oin, and Thorin 1c. Which nodes are out of bala

• 2 Pages
###### 41-Section7

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #41 February 25, 2015 Section Handout #7Graphs The purpose of this section is to let you work with the most important graph algorithms. Each of these questions uses the definitions of the Graph class and the Node and Arc struc

• 21 Pages
###### 03-StringsAndStreams

School: Stanford

Course: Programming Abstractions

Strings and Streams Eric Roberts CS 106B January 9, 2015 Administrative Reminders All handouts and course information are on the web site: http:/cs106b.stanford.edu/ All CS 106B students must sign up for a section by Sunday at 5:00P.M. The signup form wen

• 17 Pages
###### 04-CollectionClasses1

School: Stanford

Course: Programming Abstractions

Collection Classes (Part 1: Vectors, Grids, Stacks, and Queues) Eric Roberts CS 106B January 12, 2015 Computer Forum Career Fair Computer Forum Career Fair (For CS and EE Students) Wed, January 14, 11am 4pm Computer Forum Career Fair Wednesday, January 14

• 21 Pages
###### Chapter8

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! Memory Snapshot 1. x => 2. 0 x => 0 1 2 3 1 1 2 3 2 3 4 0 1 2 3 0 1 2 3 2 3 3 4 5 0 1 2 3 4 5 6 4 5 6 7 0 1 2 3 Program Output 3. 15 4. 6 5. 5 6. 10 Multiple-Choice Problems 7. (e) 8. (a) 9. (c) 10. (d) Programming Exercises Power Plant Dat

• 11 Pages
###### Chapter10

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! True/False Problems 1. 2. 3. 4. 5. F T F T T Multiple Choice Problems 6. (d) 7. (c) Programming Problems Binary Trees /*-*/ /* Program chapter10_8 */ /numLeafNodes: Public method int BinaryTree:numLeafNodes() const cfw_ if(root = NULL) cfw_

• 13 Pages
###### Chapter9

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! True/False Problems 1. T 2. T 3. F 4. F Multiple Choice Problems 5. (a) 6. (b) 7. (d) 8. (b) Memory Snapshot Problems 9. name=>20.5 x=>20.5 a=>14 10. 5 11. 12 12. 5 13. 5 Vector Functions /*-*/ /* Problem chapter9_14 */ /* */ /* This functi

• 36 Pages
###### Chapter6

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! True/False Problems 1. T 2. F 3. T 4. T 5. F 6. T 7. T Multiple Choice Problems 8. (b) 9. (a) 10. (d) Program Analysis 11. 1 12. 0 13. 0 14. Results using negative integers may not be as expected. Memory Snapshot Problems 15. v1-> [double x

• 33 Pages
###### Chapter5

School: Stanford

Course: Standard C++ Programming Laboratory

Exam Practice! True/False Problems 1. F 2. F 3. F 4. F 5. F Multiple-Choice Problems 6. (b)and(c) 7. (c) Memory Snapshot Problems 8. int i->0 int j->0 double x->1.0 double y->5.2 char ch1->a char ch2->, 9. int i->5 int j->0 double x->1.0 double y->? char

• 19 Pages
• ###### 08-RecursiveBacktracking
• Register Now
###### 08-RecursiveBacktracking

School: Stanford

Course: Programming Abstractions

Recursive Backtracking Eric Roberts CS 106B January 23, 2015 Solving a Maze A journey of a thousand miles begins with a single step. Lao Tzu, 6th century B.C.E. The example most often used to illustrate recursive backtracking is the problem of solving a m

• 21 Pages
###### 07-RecursiveStrategies

School: Stanford

Course: Programming Abstractions

Recursive Strategies Eric Roberts CS 106B January 21, 2015 Recursion One of the most important Great Ideas in CS 106B is the concept of recursion, which is the process of solving a problem by dividing it into smaller subproblems of the same form. The ital

• 20 Pages
###### 06-DesigningClasses

School: Stanford

Course: Programming Abstractions

Designing Classes Eric Roberts CS 106B January 16, 2015 Optional Movie And so even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream. I have a dream that one day this nation will

• 16 Pages
###### 05-CollectionClasses2

School: Stanford

Course: Programming Abstractions

Collection Classes (Part 2: Maps, Sets, and Lexicons) Eric Roberts CS 106B January 14, 2015 Optional Movie And so even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream. I have a

• 6 Pages
###### 26-PracticeMidterm1

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #26 February 4, 2015 Practice Midterm Exam #1 Review session: Sunday, February 8, 7:009:00 P.M., Bishop Auditorium Midterm #1: Tuesday, February 10, 2:154:15 P.M., Annenberg Auditorium Midterm #2: Tuesday, February 10, 7:009:0

• 16 Pages
###### 44-Assignment6

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #44 February 27, 2015 Assignment #6Basic Due date: Friday, March 13 Note: Assignment #6 will not be accepted after 5:00 P.M. on Monday, March 16 2 In 1975, Bill Gates and Paul Allen started the company that would become Micros

• 4 Pages
• ###### 20-SortingAndEfficiency
• Register Now
###### 20-SortingAndEfficiency

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #20 January 28, 2015 Sorting and Efficiency Sorting Sorting and Efficiency Of all the algorithmic problems that computer scientists have studied, the one with the broadest practical impact is certainly the sorting problem, wh

• 3 Pages
###### 19A-Section3Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #19A January 26, 2015 Solutions to Section Handout #3 Problem 1. Weights and balances 2 Problem 2. Shortest path Problem 3. Filling a region 3 Problem 4. Generating multiword anagrams

• 6 Pages
###### 15A-Section2Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #15A January 21, 2015 Solutions to Section Handout #2 Problem 1. Using grids 2 Problem 2. Using queues 3 Problem 3. Using maps 4 5 6 Problem 4. Using lexicons

• 3 Pages
• ###### 16-RecursiveBacktracking
• Register Now
###### 16-RecursiveBacktracking

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #16 January 23, 2015 Recursive Backtracking Solving a Maze Recursive Backtracking Eric Roberts CS 106B January 23, 2015 The Right-Hand Rule A journey of a thousand miles begins with a single step. Lao Tzu, 6th century B.C.E.

• 4 Pages
###### 19-Section3

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #19 January 26, 2015 Section Handout #3Recursion The purpose of this section is to give you some additional practice solving recursive problems. Problem 1. Weights and balances (Chapter 8, exercise 6, page 378) I am the only c

• 3 Pages
• ###### 17-BacktrackingAndGames
• Register Now
###### 17-BacktrackingAndGames

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #17 January 26, 2015 Backtracking and Games Searching in a Branching Structure The recursive structure for finding the solution path in a maze comes up in a wide variety of applications, characterized by the need to explore a

• 8 Pages
###### 18-Assignment3

School: Stanford

Course: Programming Abstractions

Eric Roberts CS106B Handout #18 January 26, 2015 Assignment #3Recursion Parts of this handout were written by Julie Zelenski and Jerry Cain. Due: Wednesday, February 4 YEAH Hours: Wednesday, January 28, 7:00-9:00 P.M., Braun Auditorium This weeks assignme

• 3 Pages
###### 14-RecursiveStrategies

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #14 January 21, 2015 Recursive Strategies Recursion Recursive Strategies Eric Roberts CS 106B January 21, 2015 One of the most important Great Ideas in CS 106B is the concept of recursion, which is the process of solving a pr

• 2 Pages
###### 10-CollectionClasses2

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #10 January 14, 2015 Collection Classes (Part 2) Optional Movie Collection Classes (Part 2: Maps, Sets, and Lexicons) Eric Roberts CS 106B January 14, 2015 And so even though we face the difficulties of today and tomorrow, I s

• 4 Pages
###### 23-Section4

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #23 February 2, 2015 Section Handout #4 Pointers and Memory Problem 1. Differentiating the stack and the heap Using the heap-stack diagrams from Chapter 12 as a model, draw a diagram showing how memory is allocated just before

• 3 Pages
###### 23A-Section4Solutions

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #23A February 2, 2015 Solutions to Section Handout #4 Problem 1. Differentiating the stack and the heap 1a) Diagram using explicit addresses: 1b) Diagram using arrows: Problem 2: Pointer arithmetic 2a) a1[1] 2001 2b) a2[2] 3.

• 41 Pages
###### 02-CourseInformation

School: Stanford

Course: Programming Abstractions

5 CS 106B Calendar Monday January 5 Wednesday 7 Course overview The big ideas in CS 106B The C+ language C+ vs. Java Friday 9 Functions in C+ Call by reference Libraries and interfaces Recursive functions Using the string class File streams Class hierarch

• 3 Pages
###### 42-GraphAlgorithms

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #42 February 25, 2015 Graph Algorithms Outline Graph Algorithms 1. A review the graphtypes.h and graph.h interfaces 2. Depth-first and breadth-first search 3. Dijkstras shortest-path algorithm 4. Kruskals minimum-spanning-tree

• 4 Pages
###### 40-Graphs

School: Stanford

Course: Programming Abstractions

Eric Roberts and Kevin Miller CS 106B Handout #40 February 23, 2015 Graphs Outline Graphs 1. Examples of graphs 2. Defining a graph in terms of sets 3. Graph terminology 4. Designing the graph.h interface Kevin Miller (standing in for Eric Roberts) CS 106

• 4 Pages
###### 43-Inheritance

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #43 February 27, 2015 Inheritance in C+ Class Hierarchies Inheritance in C+ Much of the power of modern object-oriented languages comes from the fact that they support class hierarchies. Any class can be designated as a subcl

• 2 Pages
###### 45-BasicContest

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #45 February 27, 2015 BASIC Contest Submission deadline: Friday, March 13, 5:00 P.M. [Paul] Allen rushed to the dorm to find Bill Gates. They had to do a BASIC for this machine. They had to. If they didnt, the revolution would

• 5 Pages
###### 39-Sets

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #39 February 20, 2015 Sets Outline Sets 1. Midcourse correction 2. Sets in mathematics 3. Venn diagrams 4. High-level set operations 5. Implementing the Set class 6. Sets and efficiency Eric Roberts CS 106B February 20, 2015 7

• 4 Pages
###### 21-MemoryAndC++

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #21 January 30, 2015 Memory and C+ Data Types in C+ Memory and C+ The data types that C+ inherits from C: Atomic types: short, int, long, and their unsigned variants float, double, and long double char bool Enumerated types

• 4 Pages
###### 24-ProblemSet1

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #24 February 2, 2015 Problem Set #1 Due: Friday, February 6 by 5:00 P.M. Problem sets are pencil-and-paper exercises and may be submitted in section, in lecture, or to the box outside my office (Gates 202). Problem 1: Computat

• 3 Pages
###### 22-DynamicAllocation

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #22 February 2, 2015 Dynamic Allocation The Allocation of Memory to Variables Dynamic Allocation When you declare a variable in a program, C+ allocates space for that variable from one of several memory regions. One region o

• 3 Pages
###### 15-Section2

School: Stanford

Course: Programming Abstractions

Eric Roberts CS 106B Handout #15 January 21, 2015 Section Handout #2ADTs Problem 1. Using grids (Chapter 5, exercise 10, page 252) In the game of Minesweeper, a player searches for hidden mines on a rectangular grid that mightfor a very small boardlook li

• 31 Pages
###### 11-backtracking

School: Stanford

Course: Programming Abstractions

CS 106B, Lecture 11 Exhaustive Search and Backtracking reading: Programming Abstractions in C+, Chapters 8.2 - 8.3; 9 This document is copyright (C) Stanford Computer Science and Marty Stepp, licensed under Creative Commons Attribution 2.5 License. All ri

• 3 Pages
###### Section #8 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Section 8 Solutions (Week 10) 1. hash1 is valid, but not good because everything will get hashed to the same bucket. hash2 is not valid, because A and a are equal, but will have different hash values

• 4 Pages
###### Section #7 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Section 7 Solutions (Week 9) Presection problem. V: cfw_CS1, CS2, CS3, CS4, CS5, CS6, CS7, CS8 E: cfw_CS1-CS2, CS2-CS3, CS2-CS4, CS2-CS5, CS3-CS7, CS3-CS8, CS4-CS6, CS5-CS6, CS5-CS7, CS5-CS8 Adjacency List: C

• 4 Pages
###### Section #6 Solutions

School: Stanford

Course: Programming Abstractions

CS 106B Section 6 Solutions (Week 8) Presection problem. Dwalin / \ Balin Kili \ / \ Dori Fili Nori /

• 4 Pages
###### Section #5 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Section 5 Solutions (Week 6) Presection problems 1. 2. v1 : 70 v2 : 25 p1 : points to v1 p2 : points to v1 list->next->next->next->next = list->next->next; / 40->30 l

• 2 Pages
###### Section #8

School: Stanford

Course: Programming Abstractions

CS 106B Section 8 Handout (Week 10) The last section! This week has a little bit of new content, and then some problems to review some of the bigger concepts from the second half of the quarter. Recommended problems

• 4 Pages
###### Section #6

School: Stanford

Course: Programming Abstractions

CS 106B Section 6 Handout (Week 8) This week is all binary trees. Remember that the recursive structure of trees makes writing recursive methods for them very natural. Recommended problems: 3, 8, 12, 13. (Try to do a

• 4 Pages
###### Section #5

School: Stanford

Course: Programming Abstractions

CS 106B Section 5 Handout (Week 6) ListNode structure (represents a single data value in a linked list, and a link to the next node) struct ListNode cfw_ int data; / data stored in this node

• 2 Pages
###### Section #4 Solutions

School: Stanford

Course: Programming Abstractions

CS106B Section 4 Solutions (Week 5) 1. 2. Presection problem. Changes to lecture code (from slide 21 of 11-backtracking) are underlined. The sumAll method is unchanged, so it is not included here. (It just takes a

• 2 Pages
###### Section #4

School: Stanford

Course: Programming Abstractions

CS106B Section 4 Handout (Week 5) 1. 2. 3. 4. This week takes recursion a bit further with recursive backtracking. Remember Martys three steps to doing backtracking problems, where you need to explore multiple paths i

• 12 Pages
###### 01-intro-to-cpp

School: Stanford

Course: Programming Abstractions