# Turn in a printout of your code exercises stapled to your answers to the written exercises at 2:10 PM on Thursday, January 13th.

Save this PDF as:

Size: px
Start display at page:

## Transcription

3 Exercise 3.4 More About Dictionaries In homework 3.py, under the Exercise 3.4 heading, notice that we ve defined two lists: NAMES = [ Alice, Bob, Cathy, Dan, Ed, Frank, Gary, Helen, Irene, Jack, Kelly, Larry ] AGES = [20, 21, 18, 18, 19, 20, 20, 19, 19, 19, 22, 19] These lists match up, so Alice s age is 20, Bob s age is 21, and so on. Write a function combine lists that combines these lists into a dictionary (hint: what should the keys, and what should the values, of this dictionary be? ). Then, write a function people that takes in an age and returns the names of all the people who are that age. Test your program s functions by running these lines (they are commented at the bottom of the code file; uncomment them to use them): print Dan in people(18) and Cathy in people(18) print Ed in people(19) and Helen in people(19) and\ Irene in people(19) and Jack in people(19) and Larry in people(19) print Alice in people(20) and Frank in people(20) and Gary in people(20) print people(21) == [ Bob ] print people(22) == [ Kelly ] print people(23) == [] All lines should print True. The last line is an edge condition that we re testing; your people function should be able to handle this condition (hint: what is this condition?) by simply returning an empty list... Exercise 3.5 Zeller s Algorithm, revisited This is similar to the optional problem from Homework 1, but in this version we will be writing a function that takes parameters, and using dictionaries to facilitate pretty printing (where the answer is given to the user in a nice looking fashion). For the rules of the algorithm, please take a look at the description written in Homework 1 (available as a pdf online, under the Materials section of the course website). Calling zellers( March, 10, 1940) should give the output: Sunday Hints: 1. Use a dictionary to map between the month and its numerical value. 2. You can use either a list or dictionary to convert the final output of the algorithm to the day of the week. 3. Make sure you handle the following three points correctly. Note: If the month is January or February, then the preceding year is used for computation. This is because there was a period in history when March 1st, not January 1st, was the beginning of the year. If the computed value of R is a negative number, add 7 to get a nonnegative number between 0 and 6. You might need to use one of the following (but, maybe not): To convert the string 90 to the number 90, use int( 90 ); to convert the int 90 to the string 90, use str(90). 3

6 MIT OpenCourseWare A Gentle Introduction to Programming January IAP 2011 For information about citing these materials or our Terms of Use, visit:

### 6.189 D ay 6. Name: R eadings. E x er cise 6. 1 { W ar mup: F inding B ugs

6.189 D ay 6 Name: T urn in your written answers to 6.1 and 6.2, stapled to your printed code les, tomorrow at the start of lecture. R eadings How T o T hink L ike A C omputer Scientist, chapter 10. E

### Recall that strings and tuples are immutable datatypes, while lists are mutable datatypes. What does this mean?

6.189 Day 4 Readings How To Think Like A Computer Scientist, chapters 7 and 8 6.01 Fall 2009 Course Notes page 27-29 ( Lists and Iterations over lists ; List Comprehensions is optional); sections 3.2-3.4

### Name & Recitation Section:

Name & Recitation Section: Due Thursday, Jan 13 at 2:10 PM in 34-101. Please print out your code files (homework 3.py, queue.py, and any code you wrote for optional problems), and staple them to the back

### Name & Recitation Section:

Name & Recitation Section: Due Wednesday, Jan 5 at 2:10 PM in 34-101. Please print out your code files (homework 1.py, rps.py, loops.py, and any code you wrote for optional problems), staple them to the

### 6.189 Project 1. Readings. What to hand in. Project 1: The Game of Hangman. Get caught up on all the readings from this week!

6.189 Project 1 Readings Get caught up on all the readings from this week! What to hand in Print out your hangman code and turn it in Monday, Jaunary 10 at 2:10 PM. Be sure to write your name and section

### MIT AITI Python Software Development

MIT AITI Python Software Development PYTHON L02: In this lab we practice all that we have learned on variables (lack of types), naming conventions, numeric types and coercion, strings, booleans, operator

### Turn in a printout of your code exercises stapled to your answers to the written exercises by 2:10 PM on Tuesday, January 18th.

6.189 Homework 4 Readings How To Think Like A Computer Scientist: Wednesday: Make sure you ve finished Chapters 12-14 (all), & Chapter 16 (all); Thursday - get all readings finished! What to turn in Turn

### How To Think Like A Computer Scientist, chapter 3; chapter 6, sections

6.189 Day 3 Today there are no written exercises. Turn in your code tomorrow, stapled together, with your name and the file name in comments at the top as detailed in the Day 1 exercises. Readings How

### If Statements, For Loops, Functions

Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements

### MITOCW watch?v=flgjisf3l78

MITOCW watch?v=flgjisf3l78 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

### PROBLEM SOLVING 11. July 24, 2012

PROBLEM SOLVING 11 COMPUTER SCIENCE 61A July 24, 2012 Today s section will be a kind of Meta-Section, we are going to walk through some medium to hard-ish problems in Scheme, and we will discuss some methods

### CSC148H Week 3. Sadia Sharmin. May 24, /20

CSC148H Week 3 Sadia Sharmin May 24, 2017 1/20 Client vs. Developer I For the first couple of weeks, we have played the role of class designer I However, you are also often in the opposite role: when a

### The Dynamic Typing Interlude

CHAPTER 6 The Dynamic Typing Interlude In the prior chapter, we began exploring Python s core object types in depth with a look at Python numbers. We ll resume our object type tour in the next chapter,

### Intro to Python & Programming. C-START Python PD Workshop

Don t just buy a new video game, make one. Don t just download the latest app, help design it. Don t just play on your phone, program it. No one is born a computer scientist, but with a little hard work

### 6.S189 Homework 1. What to turn in. Exercise 1.1 Installing Python. Exercise 1.2 Hello, world!

6.S189 Homework 1 http://web.mit.edu/6.189/www/materials.html What to turn in Do the warm-up problems for Days 1 & 2 on the online tutor. Complete the problems below on your computer and get a checkoff

### 1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous

University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming The Stack Abstraction Conventions Provide Implicit Information What does

### CS2304: Python for Java Programmers. CS2304: Sequences and Collections

CS2304: Sequences and Collections Sequences In Python A sequence type in python supports: The in membership operator. The len() function. Slicing like we saw with strings, s[1:3]. And is iterable (for

### CS 360: Programming Languages Lecture 10: Introduction to Haskell

CS 360: Programming Languages Lecture 10: Introduction to Haskell Geoffrey Mainland Drexel University Thursday, February 5, 2015 Adapted from Brent Yorgey s course Introduction to Haskell. Section 1 Administrivia

### Expressions and Variables

Expressions and Variables Expressions print(expression) An expression is evaluated to give a value. For example: 2 + 9-6 Evaluates to: 5 Data Types Integers 1, 2, 3, 42, 100, -5 Floating points 2.5, 7.0,

### Lecture 6 CS2110 Spring 2013 RECURSION

Lecture 6 CS2110 Spring 2013 RECURSION Recursion 2 Arises in three forms in computer science Recursion as a mathematical tool for defining a function in terms of its own value in a simpler case Recursion

### 6.01, Spring Semester, 2008 Assignment 3, Issued: Tuesday, February 19 1

6.01, Spring Semester, 2008 Assignment 3, Issued: Tuesday, February 19 1 MASSACHVSETTS INSTITVTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.01 Introduction to EECS I Spring

### Logistics. Half of the people will be in Wu & Chen The other half in DRLB A1 Will post past midterms tonight (expect similar types of questions)

Data Structures Logistics Midterm next Monday Half of the people will be in Wu & Chen The other half in DRLB A1 Will post past midterms tonight (expect similar types of questions) Review on Wednesday Come

### ECE 364 Software Engineering Tools Laboratory. Lecture 4 Python: Collections I

ECE 364 Software Engineering Tools Laboratory Lecture 4 Python: Collections I 1 Lecture Summary Lists Tuples Sets Dictionaries Printing, More I/O Bitwise Operations 2 Lists list is a built-in Python data

### Collections. Lists, Tuples, Sets, Dictionaries

Collections Lists, Tuples, Sets, Dictionaries Homework notes Homework 1 grades on canvas People mostly lost points for not reading the document carefully Didn t play again Didn t use Y/N for playing again

### Loop structures and booleans

Loop structures and booleans Michael Mandel Lecture 7 Methods in Computational Linguistics I The City University of New York, Graduate Center https://github.com/ling78100/lectureexamples/blob/master/lecture07final.ipynb

### 6.S189 Homework 2. What to turn in. Exercise 3.1 Defining A Function. Exercise 3.2 Math Module.

6.S189 Homework 2 http://web.mit.edu/6.s189/www/materials.html What to turn in Checkoffs 3, 4 and 5 are due by 5 PM on Monday, January 15th. Checkoff 3 is over Exercises 3.1-3.2, Checkoff 4 is over Exercises

### C++ Data Types. 1 Simple C++ Data Types 2. 3 Numeric Types Integers (whole numbers) Decimal Numbers... 5

C++ Data Types Contents 1 Simple C++ Data Types 2 2 Quick Note About Representations 3 3 Numeric Types 4 3.1 Integers (whole numbers)............................................ 4 3.2 Decimal Numbers.................................................

### CMSC 201 Computer Science I for Majors

CMSC 201 Computer Science I for Majors Lecture 02 Intro to Python Syllabus Last Class We Covered Grading scheme Academic Integrity Policy (Collaboration Policy) Getting Help Office hours Programming Mindset

### CSC148 Week 2. Larry Zhang

CSC148 Week 2 Larry Zhang 1 Admin Discussion board is up (link on the course website). 2 Outline for this week Abstract Data Type Stack Queue 3 Abstract Data Type (ADT) 4 What is an abstract data type

### Discussion 2C Notes (Week 3, January 21) TA: Brian Choi Section Webpage:

Discussion 2C Notes (Week 3, January 21) TA: Brian Choi (schoi@cs.ucla.edu) Section Webpage: http://www.cs.ucla.edu/~schoi/cs32 Abstraction In Homework 1, you were asked to build a class called Bag. Let

### A lot of people make repeated mistakes of not calling their functions and getting errors. Make sure you're calling your functions.

Handout 2 Functions, Lists, For Loops and Tuples [ ] Functions -- parameters/arguments, "calling" functions, return values, etc. Please make sure you understand this example: def square(x): return x *

### TUPLES AND RECURSIVE LISTS 5

TUPLES AND RECURSIVE LISTS 5 COMPUTER SCIENCE 61A July 3, 2012 1 Sequences From the Pig project, we discovered the utility of having structures that contain multiple values. Today, we are going to cover

### Text Input and Conditionals

Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

### n! = 1 * 2 * 3 * 4 * * (n-1) * n

The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems which are

### Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

### Accelerating Information Technology Innovation

Accelerating Information Technology Innovation http://aiti.mit.edu/program/philippines-summer-2012/ Philippines Summer 2012 Lecture 1 Introduction to Python June 19, 2012 Agenda About the Course What is

### Try typing the following in the Python shell and press return after each calculation. Write the answer the program displays next to the sums below.

Name: Date: Instructions: PYTHON - INTRODUCTORY TASKS Open Idle (the program we will be using to write our Python codes). We can use the following code in Python to work out numeracy calculations. Try

### Exercise 6.2 A generic container class

Exercise 6.2 A generic container class The goal of this exercise is to write a class Array that mimics the behavior of a C++ array, but provides more intelligent memory management a) Start with the input

### Programming Fundamentals and Python

Chapter 2 Programming Fundamentals and Python This chapter provides a non-technical overview of Python and will cover the basic programming knowledge needed for the rest of the chapters in Part 1. It contains

### Practice Midterm Exam #1

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

### PREPARING FOR PRELIM 1

PREPARING FOR PRELIM 1 CS 1110: FALL 2012 This handout explains what you have to know for the first prelim. There will be a review session with detailed examples to help you study. To prepare for the prelim,

### Dmitriy Shironosov/ShutterStock, Inc. Abstract Data Types Abstract Data Types

Dmitriy Shironosov/ShutterStock, Inc. Abstract Data Types 85 LABORATORY 9 Abstract Data Types OBJECTIVE Gain a deeper appreciation for stacks, queues, and trees. REFERENCES Software needed: 1) Stack-Queue

### 3137 Data Structures and Algorithms in C++

3137 Data Structures and Algorithms in C++ Lecture 3 July 12 2006 Shlomo Hershkop 1 Announcements Homework 2 out tonight Please make sure you complete hw1 asap if you have issues, please contact me will

### Problem Solving for Intro to Computer Science

Problem Solving for Intro to Computer Science The purpose of this document is to review some principles for problem solving that are relevant to Intro to Computer Science course. Introduction: A Sample

### Recursion. Chapter Simple Recursion. Goals Trace recursive algorithms Implement recursive algorithms

Chapter 19 Recursion Goals Trace recursive algorithms Implement recursive algorithms 19.1 Simple Recursion One day, an instructor was having difficulties with a classroom s multimedia equipment. The bell

### CMSC th Lecture: Graph Theory: Trees.

CMSC 27100 26th Lecture: Graph Theory: Trees. Lecturer: Janos Simon December 2, 2018 1 Trees Definition 1. A tree is an acyclic connected graph. Trees have many nice properties. Theorem 2. The following

### Program Planning, Data Comparisons, Strings

Program Planning, Data Comparisons, Strings Program Planning Data Comparisons Strings Reading for this class: Dawson, Chapter 3 (p. 80 to end) and 4 Program Planning When you write your first programs,

### CS 2316 Learning Objectives

CS 2316 Learning Objectives This document lists the CS 2316 Learning Objectives and tries to give you an idea of what each learning objective encompases. Each learning objective will have a list of concepts

### Lecture 5: Implementing Lists, Version 1

CS18 Integrated Introduction to Computer Science Fisler, Nelson Lecture 5: Implementing Lists, Version 1 Contents 1 Implementing Lists 1 2 Methods 2 2.1 isempty...........................................

### Problem One: A Quick Algebra Review

CS103A Winter 2019 Solutions for Week One Handout 01S Problem One: A Quick Algebra Review In the first week of CS103, we'll be doing a few proofs that will require some algebraic manipulations and reasoning

### Overview of List Syntax

Lists and Sequences Overview of List Syntax x = [0, 0, 0, 0] Create list of length 4 with all zeroes x 4300112 x.append(2) 3 in x x[2] = 5 x[0] = 4 k = 3 Append 2 to end of list x (now length 5) Evaluates

### Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

### Discussion 4. Data Abstraction and Sequences

Discussion 4 Data Abstraction and Sequences Data Abstraction: The idea of data abstraction is to conceal the representation of some data and to instead reveal a standard interface that is more aligned

### Artificial Intelligence A Primer for the Labs

Artificial Intelligence A Primer for the Labs Mathias Broxvall, Lia Susana d.c. Silva Lopez, November 2011 Chapter 1 General python instructions This document contains a quick primer for using Python

### 9/16/14. Overview references to sections in text RECURSION. What does generic mean? A little about generics used in A3

Overview references to sections in text 2 Note: We ve covered everything in JavaSummary.pptx! What is recursion 7.1-7.39 slide 1-7 Base case 7.1-7.10 slide 13 How Java stack frames work 7.8-7.10 slide

### Python: common syntax

Lab 09 Python! Python Intro Main Differences from C++: True and False are capitals Python floors (always down) with int division (matters with negatives): -3 / 2 = -2 No variable data types or variable

### Homework: More Abstraction, Trees, and Lists

Homework: More Abstraction, Trees, and Lists COMP 50 Fall 2013 This homework is due at 11:59PM on Monday, November 18. Submit your solutions in a single file using the COMP 50 Handin button on DrRacket;

### Lecture 3. Input, Output and Data Types

Lecture 3 Input, Output and Data Types Goals for today Variable Types Integers, Floating-Point, Strings, Booleans Conversion between types Operations on types Input/Output Some ways of getting input, and

### CS Summer 2013

CS 1110 - Summer 2013 intro to programming -- how to think like a robot :) we use the Python* language (www.python.org) programming environments (many choices): Eclipse (free from www.eclipse.org), or

### Practice Midterm Exam #1

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

### SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

### Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department 0901212 Python Programming 1 st Semester 2014/2015 Course Catalog This course introduces

### Lab 4: Imperative & Debugging 12:00 PM, Feb 14, 2018

CS18 Integrated Introduction to Computer Science Fisler, Nelson Lab 4: Imperative & Debugging 12:00 PM, Feb 14, 2018 Contents 1 Imperative Programming 1 1.1 Sky High Grades......................................

### Lecture Agenda. Objects. But First... Immutable Types and Nesting. Immutable Types and Nesting

COMP10001 Foundations of Computing Objects and Types: A Closer Look (Advanced Lecture) Semester 1, 2017 Tim Baldwin & Egemen Tanin Lecture Agenda This lecture: Making sense of strings, lists and functions

### Discussion 1H Notes (Week 3, April 14) TA: Brian Choi Section Webpage:

Discussion 1H Notes (Week 3, April 14) TA: Brian Choi (schoi@cs.ucla.edu) Section Webpage: http://www.cs.ucla.edu/~schoi/cs31 More on Arithmetic Expressions The following two are equivalent:! x = x + 5;

### 6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

### Computer Science 9608 (Notes) Chapter: 4.1 Computational thinking and problem-solving

In Computer Science, an abstract data type (ADT) is a mathematical model for a certain data type or structures. This doesn t mean that the ADTs cannot be programmed. But that we must first understand them

### Introduction to Python

Introduction to Python Reading assignment: Perkovic text, Ch. 1 and 2.1-2.5 Python Python is an interactive language. Java or C++: compile, run Also, a main function or method Python: type expressions

### CS 4349 Lecture October 18th, 2017

CS 4349 Lecture October 18th, 2017 Main topics for #lecture include #minimum_spanning_trees. Prelude Homework 6 due today. Homework 7 due Wednesday, October 25th. Homework 7 has one normal homework problem.

### Lecture 7 CS2110 Fall 2014 RECURSION

Lecture 7 CS2110 Fall 2014 RECURSION Overview references to sections in text 2 Note: We ve covered everything in JavaSummary.pptx! What is recursion? 7.1-7.39 slide 1-7 Base case 7.1-7.10 slide 13 How

### Lab 6: P.S. it s a stack Due 11:59 pm Monday, Mar 31, 2008

1 Assignment Lab 6: P.S. it s a stack Due 11:59 pm Monday, Mar 31, 2008 An interpreter is a program that executes other programs. For example, the Java Virtual Machine that you run using the java program

### 10. A Weekend to Remember

10. A Weekend to Remember Weekends don't count unless you spend them doing something completely pointless. Bill Watterson. Programming constructs and algorithmic paradigms covered in this puzzle: Graph

### INTERMEDIATE LEVEL PYTHON PROGRAMMING SELECTION AND CONDITIONALS V1.0

INTERMEDIATE LEVEL PYTHON PROGRAMMING SELECTION AND CONDITIONALS V1.0 OCTOBER 2014 Python Selection and Conditionals 1 SELECTION AND CONDITIONALS WHAT YOU MIGHT KNOW ALREADY You will probably be familiar

### CSE 143. Computer Programming II

Adam Blank Lecture 17 Winter 2015 CSE 143 Computer Programming II CSE 143: Computer Programming II Recursive Backtracking Recursive Backtracking Outline 1 Sentence Splitter 2 Playing With Boolean Expressions

### Munster Programming Training - Cycle 2

Munster Programming Training - Cycle 2 Lecture 3 - Binary Search & Queues & Stacks Bastien Pietropaoli bastien.pietropaoli@insight-centre.org Time complexity Previously On MPT Cycle 2 Recursions Exercise

### For strings (and tuples, when we get to them), its easiest to think of them like primitives directly stored in the variable table.

Page 1 6.189 Notes Session 8 Day 6: Immutable Objects Earlier, we made a big deal about the fact that lists are mutable. The reason this is important is because certain objects are immutable once created,

### Teaching London Computing

Teaching London Computing A Level Computer Science Topic 3: Advanced Programming in Python William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London Aims Further

### Be careful when deciding whether to represent data as integers or floats, and be sure that you consider all possible behaviors in computation.

Table of Contents: 1. Integers and floats 2. for vs. while loops 3. Checking boolean conditions with if/else 4. Docstrings 5. Changing collections while iterating over them 6. Directly Accessing Instance

### CSCI-1200 Data Structures Spring 2018 Lecture 14 Associative Containers (Maps), Part 1 (and Problem Solving Too)

CSCI-1200 Data Structures Spring 2018 Lecture 14 Associative Containers (Maps), Part 1 (and Problem Solving Too) HW6 NOTE: Do not use the STL map or STL pair for HW6. (It s okay to use them for the contest.)

### Hello, World! An Easy Intro to Python & Programming. Jack Rosenthal

An Easy Intro to Python & Programming Don t just buy a new video game, make one. Don t just download the latest app, help design it. Don t just play on your phone, program it. No one is born a computer

### Week - 03 Lecture - 18 Recursion. For the last lecture of this week, we will look at recursive functions. (Refer Slide Time: 00:05)

Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 03 Lecture - 18 Recursion For the

### Open and respond to this poll: PollEv.com/comp110. Calling Methods Mr. Roboto

Open and respond to this poll: PollEv.com/comp110 Lecture 1 Calling Methods Mr. Roboto Fall 2016 Special thanks to Dr. Andy van Dam, my grad school advisor, and Brown s CS15 course for this fantastic method

### 6.001 Notes: Section 17.5

6.001 Notes: Section 17.5 Slide 17.5.1 Now, let's look at one example in which changing the evaluation model allows us to explore a very different kind of computational problem. Our goal is to show how

### Building a snowman with Racket

Building a snowman with Racket Christopher Lemmer Webber March 16, 2018 This tutorial introduces some basics of programming in Racket and then guides the user through making a snowman. It assumes no previous

### csci 210: Data Structures Stacks and Queues

csci 210: Data Structures Stacks and Queues 1 Summary Topics Stacks and Queues as abstract data types ( ADT) Implementations arrays linked lists Analysis and comparison Applications: searching with stacks

### IT 4043 Data Structures and Algorithms. Budditha Hettige Department of Computer Science

IT 4043 Data Structures and Algorithms Budditha Hettige Department of Computer Science 1 Syllabus Introduction to DSA Abstract Data Types List Operation Using Arrays Stacks Queues Recursion Link List Sorting

### 1.2 Adding Integers. Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line

1.2 Adding Integers Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line Finding Sums Mentally The Commutative Property Finding Sums using And Patterns and Rules of Adding Signed

### } Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2.

Class #10: Understanding Primitives and Assignments Software Design I (CS 120): M. Allen, 19 Sep. 18 Java Arithmetic } Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = 2 + 5 / 2; 3.

### Programming Languages and Techniques (CIS120)

Programming Languages and Techniques () Lecture 9 January 31, 2018 Lists and Higher-order functions Lecture notes: Chapter 9 What is the type of this expresssion? [ (fun (x:int) -> x + 1); (fun (x:int)

### CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

### Types, Expressions, and States

8/27: solved Types, Expressions, and States CS 536: Science of Programming, Fall 2018 A. Why? Expressions represent values in programming languages, relative to a state. Types describe common properties

### SP 713 Slide Rule Practice for our MIT Museum visit By Alva Couch and Elizabeth Cavicchi

SP 713 Slide Rule Practice for our MIT Museum visit By Alva Couch and Elizabeth Cavicchi On your slide rule, look for the rows of short vertical marks, with numbers just above them. Notice how the spacing

### Lecture 19: Recursion

Lecture 19: Recursion Building Java Programs: A Back to Basics Approach by Stuart Reges and Marty Stepp Copyright (c) Pearson 2013. All rights reserved. Recursion recursion: The definition of an operation

### Posting Bridge Game Results to VCBridge.org by Bob Gruber

Posting Bridge Game Results to VCBridge.org by Bob Gruber To post bridge game results to VCBridge.org the Ventura Unit, Unit 547, web site you need three things: 1. an Internet connection, 2. ACBLscore

### CS Introduction to Programming Fall 2016

CS 1113-300 Introduction to Programming Fall 2016 Exam 3 Review - Part 2 (Python) Friday, December 2 nd, 2016 Ahmed Ibrahim 1 / 26 Course Evaluation Please take a few minutes to submit your course evaluation

### Major Assignment: Pacman Game

Major Assignment: Pacman Game 300580 Programming Fundamentals Week 10 Assignment The major assignment involves producing a Pacman style game with Clara using the Greenfoot files that are given to you.

### CMSC201 Computer Science I for Majors

CMSC201 Computer Science I for Majors Lecture 08 Lists Constants Last Class We Covered More on while loops Sentinel loops Priming Reads Boolean flags 2 Any Questions from Last Time? 3 Today s Objectives