Administrative Notes January 19, 2017

Size: px
Start display at page:

Download "Administrative Notes January 19, 2017"

Transcription

1 Administrative Notes January 19, 2017 Reminder: In the News due on Friday Reminder: Reading Quizzes due next Monday Anne will be away next Monday and Tuesday and will not have office hours on Monday Jessica will teach Tuesday s class on the Internet

2 How do programs work? Part 2 Snap! code for Sorting 2

3 Learning goals [CT Building Block] Explain what a variable is in computer programming. [CT Building Block] Be able to trace through code using sequences of instructions, variables, loops, and conditional statements in short programs specified in a visual programming language such as Snap, or in other clearly expressed processes (which may or may not be computer related) 3

4 Programs, data and lists You ve seen programs that do simple things with data (your age, shoe size, the mouse position, text, etc.) Sorting typically involves lists of data items. We can create lists in Snap! For now, we'll create a short list of five items manually, But a list containing hundreds or more items could imported to Snap from a file

5 We can give our list a name

6 We can give our list a name

7 Why give a name to a list? Names enable us write programs that do useful things with lists, like sort them We ll first use some clicker questions to see how to query what s in a list, compare two items in the list, and more Note that the items in our list are indexed consecutively, starting from 1

8 Snap! operations on lists Clicker question What will the sprite say, when this code is run? A. 5 B. 7 C. 22 8

9 Snap! operations on lists Clicker question Suppose we make a new variable, current. What does the sprite say now? A. 3 B. 4 C. 5 D. 7 9

10 Snap! operations on lists Clicker question And now? A. 2 B. 3 C. 5 D. 7 10

11 Snap! operations on lists Clicker question Suppose we make yet another new variable, called marked and run the following code fragment Does the following inequality hold? (True or False) A. True B. False 11

12 Testing if a list is sorted Suppose we have a mystery list with five different positive numbers. How could we test whether it is sorted in increasing order? In groups, develop an algorithm to do this. Write down your algorithm in English. (Imagine that you have a list of cards.)

13 Testing if a list is sorted Student algorithm What are your algorithms?

14 Testing if a list is sorted Here s an algorithm that we ll code in Snap: Compare items 1 and 2; if item 1 is greater than item 2, then report that the list is not sorted and stop Compare items 2 and 3; if item 1 is greater than item 2, then report that the list is not sorted and stop Continue in this way until the end of the list is reached, and (if the algorithm has not already stopped) report that the list is sorted

15 Testing if a list is sorted Code for the step of comparing items 1 and 2:

16 Testing if a list is sorted Code for the step of comparing items 1 and 2: How would you change this code to do the right thing for items 2 and 3?

17 Testing if a list is sorted Code for the step of comparing items 1 and 2, plus 2 and 3:

18 Testing if a list is sorted For a list with five items, how many if blocks would we need?

19 Testing if a list is sorted For a list with five items, how many if blocks would we need? And for a list with a million items? Writing all that code would be tedious! Is there a better way to code repetitive tasks?

20 Testing if a list is sorted Student ideas (better coding of repetition) Express the code in terms of add one each time, rather than listing each step explicitly Refer to the length of list rather than using a number Use a repeat loop

21 Testing if a list is sorted: using a repeat loop Set a counter i to be 1 Repeat the following 4 times: Compare items i and i+1; if item i is greater than item i+1, then report The list is not sorted and stop Increment i by 1 Report The list is sorted

22 Testing if a list is sorted: using a repeat loop First try: make variable i, set it to 1, and compare items i and i+1

23 Testing if a list is sorted: using a repeat loop Second try: add the repeat loop:

24 How many variables are in this code? Clicker question A. 1 C. 3 B. 2 D. 4

25 Finding the smallest item in a list Recall how we did this with cards

26 Finding the smallest item in a list Recall how we did this with cards We ll use a variable called marker to store the index of the smallest item found in the list so far We ll use another variable called current to help us work through the other items in the list and compare them with the marked item

27 Finding the smallest item in a list How to initially set marker and current?

28 Finding the smallest item in a list How many times should we repeat?

29 Finding the smallest item in a list

30 What if we want to change a list?

31 What if we want to change a list? We can add and delete things from lists

32 What if we want to change a list? We can add and delete things from lists

33 What if we want to change a list? What will the list look like after the following code? A. B.

34 What if we want to change a list? What will the list look like after the following code? A. B.

35 What if we want to change a list? What will the list look like after the following code? A. B.

36 What if we want to change a list? What will the list look like after the following code? A. B.

37 We re ready to sort!

38 We re ready to sort! First, create a new list, called sorted-list, which initially has no items in it

39 We re ready to sort! Then repeat the following: Find the smallest item in the unsorted list Add it to (the end of) the sorted list Delete it from the unsorted list

40 We re ready to sort!

41 Learning Goals Revisited [CT Building Block] Explain what a variable is in computer programming. [CT Building Block] Be able to trace through code using sequences of instructions, variables, loops, and conditional statements in short programs specified in a visual programming language such as Snap, or in other clearly expressed processes (which may or may not be computer related) 41

Administrative Notes January 19, 2017

Administrative Notes January 19, 2017 Administrative Notes January 19, 2017 Reminder: In the News due on Friday Reminder: Reading Quizzes due next Monday Anne will be away next Monday and Tuesday and will not have office hours on Monday Jessica

More information

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently.

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently. The Science of Computing I Lesson 4: Introduction to Data Structures Living with Cyber Pillar: Data Structures The need for data structures The algorithms we design to solve problems rarely do so without

More information

Repetition Algorithms

Repetition Algorithms Repetition Algorithms Repetition Allows a program to execute a set of instructions over and over. The term loop is a synonym for a repetition statement. A Repetition Example Suppose that you have been

More information

CLICKERS: A TOUCH OF CLASS

CLICKERS: A TOUCH OF CLASS CLICKERS: A TOUCH OF CLASS Part 1 of 4: Installing CPS (Clicker Software) 1. Insert the CPS Installation CD into your CD-ROM drive or download the file from: http://cid.vcc.ca/p1-dl/instructions/clickers/cps.5.40.1143.0.exe.

More information

CS110D: PROGRAMMING LANGUAGE I

CS110D: PROGRAMMING LANGUAGE I CS110D: PROGRAMMING LANGUAGE I Computer Science department Lecture 5&6: Loops Lecture Contents Why loops?? While loops for loops do while loops Nested control structures Motivation Suppose that you need

More information

Algorithms. Chapter 8. Objectives After studying this chapter, students should be able to:

Algorithms. Chapter 8. Objectives After studying this chapter, students should be able to: Objectives After studying this chapter, students should be able to: Chapter 8 Algorithms Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms.

More information

8 Algorithms 8.1. Foundations of Computer Science Cengage Learning

8 Algorithms 8.1. Foundations of Computer Science Cengage Learning 8 Algorithms 8.1 Foundations of Computer Science Cengage Learning 8.2 Objectives After studying this chapter, the student should be able to: Define an algorithm and relate it to problem solving. Define

More information

Lippincott Procedures General User Training Video

Lippincott Procedures General User Training Video Lippincott Procedures General User Training Video Welcome to Lippincott Procedures! Slide 1 Welcome to Lippincott Procedures! This video will guide you through functionality for General users, including

More information

Lecture Transcript While and Do While Statements in C++

Lecture Transcript While and Do While Statements in C++ Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some

More information

Practice Midterm Examination #1

Practice Midterm Examination #1 Eric Roberts Handout #35 CS106A May 2, 2012 Practice Midterm Examination #1 Review session: Sunday, May 6, 7:00 9:00 P.M., Hewlett 200 Midterm exams: Tuesday, May 8, 9:00 11:00 A.M., CEMEX Auditorium Tuesday,

More information

Chapter 8 Algorithms 1

Chapter 8 Algorithms 1 Chapter 8 Algorithms 1 Objectives After studying this chapter, the student should be able to: Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms.

More information

SORTING AND SEARCHING

SORTING AND SEARCHING SORTING AND SEARCHING Today Last time we considered a simple approach to sorting a list of objects. This lecture will look at another approach to sorting. We will also consider how one searches through

More information

Comp 151. Control structures.

Comp 151. Control structures. Comp 151 Control structures. admin quiz this week believe it or not only 2 weeks from exam. one a week each week after that. idle debugger Debugger: program that will let you look at the program as it

More information

CPSC 311: Analysis of Algorithms (Honors) Exam 1 October 11, 2002

CPSC 311: Analysis of Algorithms (Honors) Exam 1 October 11, 2002 CPSC 311: Analysis of Algorithms (Honors) Exam 1 October 11, 2002 Name: Instructions: 1. This is a closed book exam. Do not use any notes or books, other than your 8.5-by-11 inch review sheet. Do not confer

More information

Lesson Share TEACHER'S NOTES LESSON SHARE. ing by Olya Sergeeva. Overview. Preparation. Procedure

Lesson Share TEACHER'S NOTES LESSON SHARE.  ing by Olya Sergeeva. Overview. Preparation. Procedure Lesson Share TEACHER'S NOTES Age: Adults Level: Intermediate + Time: 1 hour 40 minutes Objective: to practise writing work-related emails Key skills: writing Materials: one copy of the worksheet per student;

More information

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler As part of our integration with Banner, we have created a Faculty Advisor course for all faculty members listed in Banner,

More information

COS 116 The Computational Universe Laboratory 8: Digital Logic II

COS 116 The Computational Universe Laboratory 8: Digital Logic II COS 116 The Computational Universe Laboratory 8: Digital Logic II In this lab you ll learn that, using only AND, OR, and NOT gates, you can build a circuit that can add two numbers. If you get stuck at

More information

About this sample exam:

About this sample exam: About this sample exam: You may and SHOULD work through this exam yourself and discuss you answers with others. To find out the right answers to questions, type in the code to a compiler and run it. You

More information

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler As part of our integration with Banner, we have created a Faculty Advisor course for all faculty members listed in Banner,

More information

17 February Given an algorithm, compute its running time in terms of O, Ω, and Θ (if any). Usually the big-oh running time is enough.

17 February Given an algorithm, compute its running time in terms of O, Ω, and Θ (if any). Usually the big-oh running time is enough. Midterm Review CSE 2011 Winter 2011 17 February 2011 1 Algorithm Analysis Given an algorithm, compute its running time in terms of O, Ω, and Θ (if any). Usually the big-oh running time is enough. Given

More information

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below:

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below: Pseudocode There are 3 programming/pseudocode constructs: 1. Sequence: It refers that instructions should be executed one after another. 2. Selection: This construct is used to make a decision in choosing

More information

Chapter 4 Loops. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved.

Chapter 4 Loops. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. Chapter 4 Loops 1 Motivations Suppose that you need to print a string (e.g., "Welcome to Java!") a hundred times. It would be tedious to have to write the following statement a hundred times: So, how do

More information

CPSC 121: Models of Computation. Module 5: Predicate Logic

CPSC 121: Models of Computation. Module 5: Predicate Logic CPSC 121: Models of Computation Module 5: Predicate Logic Module 5: Predicate Logic Midterm 1: Friday February 9 th, 17:00 to 18:15 A to C (by last name): room DMP 310 D to K: room MATH 100 L to P: room

More information

Organizing Data The Power of Structure...

Organizing Data The Power of Structure... Organizing Data The Power of Structure... Notes for CSC 100 - The Beauty and Joy of Computing The University of North Carolina at Greensboro Reminders Lab this Friday: Lists! Remember Pre-lab work. Blown

More information

Comp 151. Control structures.

Comp 151. Control structures. Comp 151 Control structures. admin For these slides read chapter 7 Yes out of order. Simple Decisions So far, we ve viewed programs as sequences of instructions that are followed one after the other. While

More information

CPSC 259 admin notes

CPSC 259 admin notes CPSC 9 admin notes! TAs Office hours next week! Monday during LA 9 - Pearl! Monday during LB Andrew! Monday during LF Marika! Monday during LE Angad! Tuesday during LH 9 Giorgio! Tuesday during LG - Pearl!

More information

Searching Algorithms/Time Analysis

Searching Algorithms/Time Analysis Searching Algorithms/Time Analysis CSE21 Fall 2017, Day 8 Oct 16, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ (MinSort) loop invariant induction Loop invariant: After the

More information

A DarkBasic DataBase By:

A DarkBasic DataBase By: A DarkBasic DataBase By: Phaelax(Phaelax@hotmail.com) So you want to create a database program in DarkBasic. It s easier than you may think. Nothing more to say in this introduction, so let s get started.

More information

CSC258: Computer Organization. Memory Systems

CSC258: Computer Organization. Memory Systems CSC258: Computer Organization Memory Systems 1 Summer Independent Studies I m looking for a few students who will be working on campus this summer. In addition to the paid positions posted earlier, I have

More information

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler

Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler Moodle Quick Start Guide: Scheduling Student Appointments Using the Scheduler As part of our integration with Banner, we have created a Faculty Advisor course for all faculty members listed in Banner,

More information

Lab Two Using Wireshark to Discover IP NAME:

Lab Two Using Wireshark to Discover IP NAME: Lab Two Using Wireshark to Discover IP NAME: In this lab, we ll investigate the IP protocol, focusing on the IP datagram. We ll do so by analyzing a trace of IP datagrams sent and received by an execution

More information

Why study algorithms? CS 561, Lecture 1. Today s Outline. Why study algorithms? (II)

Why study algorithms? CS 561, Lecture 1. Today s Outline. Why study algorithms? (II) Why study algorithms? CS 561, Lecture 1 Jared Saia University of New Mexico Seven years of College down the toilet - John Belushi in Animal House Q: Can I get a programming job without knowing something

More information

COMP 250. Lecture 7. Sorting a List: bubble sort selection sort insertion sort. Sept. 22, 2017

COMP 250. Lecture 7. Sorting a List: bubble sort selection sort insertion sort. Sept. 22, 2017 COMP 250 Lecture 7 Sorting a List: bubble sort selection sort insertion sort Sept. 22, 20 1 Sorting BEFORE AFTER 2 2 2 Example: sorting exams by last name Sorting Algorithms Bubble sort Selection sort

More information

Sorting. Chapter 12. Objectives. Upon completion you will be able to:

Sorting. Chapter 12. Objectives. Upon completion you will be able to: Chapter 12 Sorting Objectives Upon completion you will be able to: Understand the basic concepts of internal sorts Discuss the relative efficiency of different sorts Recognize and discuss selection, insertion

More information

CS 137 Part 8. Merge Sort, Quick Sort, Binary Search. November 20th, 2017

CS 137 Part 8. Merge Sort, Quick Sort, Binary Search. November 20th, 2017 CS 137 Part 8 Merge Sort, Quick Sort, Binary Search November 20th, 2017 This Week We re going to see two more complicated sorting algorithms that will be our first introduction to O(n log n) sorting algorithms.

More information

Excel: Tables, Pivot Tables & More

Excel: Tables, Pivot Tables & More Excel: Tables, Pivot Tables & More February 7, 2019 Sheldon Dueck, MCT dueck21@gmail.com http://bit.ly/pivottables_fmi (Booklet) 1 Contents Tables... 3 Different ways of creating pivot tables... 4 Compact,

More information

MATH 1131Q - Calculus 1.

MATH 1131Q - Calculus 1. MATH 1131Q - Calculus 1. Álvaro Lozano-Robledo Department of Mathematics University of Connecticut Day 2 Álvaro Lozano-Robledo (UConn) MATH 1131Q - Calculus 1 2 / 30 An Example: A Very Surprising Rate

More information

Introduction to C Final Review Chapters 1-6 & 13

Introduction to C Final Review Chapters 1-6 & 13 Introduction to C Final Review Chapters 1-6 & 13 Variables (Lecture Notes 2) Identifiers You must always define an identifier for a variable Declare and define variables before they are called in an expression

More information

Lecture 02. The "Moves" and Quiz 0

Lecture 02. The Moves and Quiz 0 Lecture 02 The "Moves" and Quiz 0 Things to know about autograding You can resubmit to the autograder without penalty before the due date After your 2 nd commit there is a small waiting period enforced

More information

Computer Architecture 2/26/01 Lecture #

Computer Architecture 2/26/01 Lecture # Computer Architecture 2/26/01 Lecture #9 16.070 On a previous lecture, we discussed the software development process and in particular, the development of a software architecture Recall the output of the

More information

To become familiar with array manipulation, searching, and sorting.

To become familiar with array manipulation, searching, and sorting. ELECTRICAL AND COMPUTER ENGINEERING 06-88-211: COMPUTER AIDED ANALYSIS LABORATORY EXPERIMENT #2: INTRODUCTION TO ARRAYS SID: OBJECTIVE: SECTIONS: Total Mark (out of 20): To become familiar with array manipulation,

More information

1 CSE 100: HASH TABLES

1 CSE 100: HASH TABLES CSE 100: HASH TABLES 1 2 Looking ahead.. Watch out for those deadlines Where we ve been and where we are going Our goal so far: We want to store and retrieve data (keys) fast 3 Tree structures BSTs: simple,

More information

Simple Graph. General Graph

Simple Graph. General Graph Graph Theory A graph is a collection of points (also called vertices) and lines (also called edges), with each edge ending at a vertex In general, it is allowed for more than one edge to have the same

More information

public static <E extends Comparable<? super E>>void BubbleSort(E[] array )

public static <E extends Comparable<? super E>>void BubbleSort(E[] array ) Sorting Algorithms The 3 sorting methods discussed here all have wild signatures. For example, public static

More information

Tutorial 9. SOLUTION Since the number of supported interfaces is different for each subnet, this is a Variable- Length Subnet Masking (VLSM) problem.

Tutorial 9. SOLUTION Since the number of supported interfaces is different for each subnet, this is a Variable- Length Subnet Masking (VLSM) problem. Tutorial 9 1 Router Architecture Consider a router with a switch fabric, 2 input ports (A and B) and 2 output ports (C and D). Suppose the switch fabric operates at 1.5 times the line speed. a. If, for

More information

Tutorial 1 Creating a Personal Call Flow

Tutorial 1 Creating a Personal Call Flow Call Director Tutorial 1 Creating a Personal Call Flow This tutorial walks you through the creation of a personal call flow for John, a technician at ACME Widgets. John's requirements are typical of most

More information

Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, Global Edition. Pearson Education Limited

Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, Global Edition. Pearson Education Limited Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, Global Edition. Pearson Education Limited 2015 1 Motivations Suppose that you need to print a string (e.g., "Welcome to Java!") a

More information

APPOINTMENTS AND EVENTS

APPOINTMENTS AND EVENTS In APPOINTMENTS AND EVENTS FOCUS WPL_O717 Outlook Calendar is a scheduling tool that helps you manage appointments, events and meetings with other people. Appointments, events, and meetings are collectively

More information

Lecture 11. Lecture 11: External Sorting

Lecture 11. Lecture 11: External Sorting Lecture 11 Lecture 11: External Sorting Lecture 11 Announcements 1. Midterm Review: This Friday! 2. Project Part #2 is out. Implement CLOCK! 3. Midterm Material: Everything up to Buffer management. 1.

More information

0.1 Welcome. 0.2 Insertion sort. Jessica Su (some portions copied from CLRS)

0.1 Welcome. 0.2 Insertion sort. Jessica Su (some portions copied from CLRS) 0.1 Welcome http://cs161.stanford.edu My contact info: Jessica Su, jtysu at stanford dot edu, office hours Monday 3-5 pm in Huang basement TA office hours: Monday, Tuesday, Wednesday 7-9 pm in Huang basement

More information

Data Structures and Algorithms Sorting

Data Structures and Algorithms Sorting Data Structures and Algorithms Sorting Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/23 12-0: Sorting Sorting is

More information

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions Course contents Overview: Goodbye, calculator Lesson 1: Get started Lesson 2: Use cell references Lesson 3: Simplify formulas by using functions Overview: Goodbye, calculator Excel is great for working

More information

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming Arrays: Higher Dimensional Arrays CS0007: Introduction to Computer Programming Review If the == operator has two array variable operands, what is being compared? The reference variables held in the variables.

More information

Statistics: Interpreting Data and Making Predictions. Visual Displays of Data 1/31

Statistics: Interpreting Data and Making Predictions. Visual Displays of Data 1/31 Statistics: Interpreting Data and Making Predictions Visual Displays of Data 1/31 Last Time Last time we discussed central tendency; that is, notions of the middle of data. More specifically we discussed

More information

January 2018 Exam Timetable

January 2018 Exam Timetable January 2018 Exam Timetable School of Science & Computing Department of Computing Important notice for all students: Timetables are subject to change - revisit this site for updates Please ensure that

More information

Welcome to CS61A! Last modified: Thu Jan 23 03:58: CS61A: Lecture #1 1

Welcome to CS61A! Last modified: Thu Jan 23 03:58: CS61A: Lecture #1 1 Welcome to CS61A! This is a course about programming, which is the art and science of constructing artifacts ( programs ) that perform computations or interact with the physical world. To do this, we have

More information

COMP-202: Foundations of Programming. Lecture 4: Flow Control Loops Sandeep Manjanna, Summer 2015

COMP-202: Foundations of Programming. Lecture 4: Flow Control Loops Sandeep Manjanna, Summer 2015 COMP-202: Foundations of Programming Lecture 4: Flow Control Loops Sandeep Manjanna, Summer 2015 Announcements Check the calendar on the course webpage regularly for updates on tutorials and office hours.

More information

Course No: 4411 Database Management Systems Fall 2008 Midterm exam

Course No: 4411 Database Management Systems Fall 2008 Midterm exam Course No: 4411 Database Management Systems Fall 2008 Midterm exam Last Name: First Name: Student ID: Exam is 80 minutes. Open books/notes The exam is out of 20 points. 1 1. (16 points) Multiple Choice

More information

PROGRAMMING CONCEPTS

PROGRAMMING CONCEPTS ch01.qxd 9/19/02 9:17 AM Page 1 C H A P T E R 1 PROGRAMMING CONCEPTS CHAPTER OBJECTIVES In this Chapter, you will learn about: The Nature of a Computer Program and Programming Languages Page 2 Good Programming

More information

Understanding the problem

Understanding the problem 2.1.1 Problem solving and design An algorithm is a plan, a logical step-by-step process for solving a problem. Algorithms are normally written as a flowchart or in pseudocode. The key to any problem-solving

More information

CS 261 Spring 2013 Midterm

CS 261 Spring 2013 Midterm CS 261 Spring 2013 Midterm Name: Student ID: 1: 2: 3: 4: 5: 6: Total: 1. (20 points) Suppose that we implement a simplified version of the dynamic array data structure in which the amount of memory allocated

More information

Logic & Algorithms Foundations of Computer Science Behrouz A. Forouzan, Brooks/Cole Thomson Learning, Pacific Grove, USA, 2003.

Logic & Algorithms Foundations of Computer Science Behrouz A. Forouzan, Brooks/Cole Thomson Learning, Pacific Grove, USA, 2003. OVERVIEW Logic & Algorithms Foundations of Computer Science Behrouz A. Forouzan, Brooks/Cole Thomson Learning, Pacific Grove, USA, 2003. OBJECTIVES After reading this chapter, the reader should be able

More information

Introduction to Functional Programming. Slides by Koen Claessen and Emil Axelsson

Introduction to Functional Programming. Slides by Koen Claessen and Emil Axelsson Introduction to Functional Programming Slides by Koen Claessen and Emil Axelsson Goal of the Course Start from the basics Learn to write small-to-medium sized programs in Haskell Introduce basic concepts

More information

2.3 Algebraic properties of set operations

2.3 Algebraic properties of set operations CHAPTER 2. SETS 38 2.3 Algebraic properties of set operations When a mathematician thinks of algebraic properties what they mean is this: we have two things and we combine them to make a third; what sorts

More information

CS 374 Fall 2014 Homework 5 Due Tuesday, October 14, 2014 at noon

CS 374 Fall 2014 Homework 5 Due Tuesday, October 14, 2014 at noon CS 374 Fall 2014 Homework 5 Due Tuesday, October 14, 2014 at noon 1. Dance Dance Revolution is a dance video game, first introduced in Japan by Konami in 1998. Players stand on a platform marked with four

More information

Differentiability and Tangent Planes October 2013

Differentiability and Tangent Planes October 2013 Differentiability and Tangent Planes 14.4 04 October 2013 Differentiability in one variable. Recall for a function of one variable, f is differentiable at a f (a + h) f (a) lim exists and = f (a) h 0 h

More information

Chapter 3: Mirrors and Lenses

Chapter 3: Mirrors and Lenses Chapter 3: Mirrors and Lenses Chapter 3: Mirrors and Lenses Lenses Refraction Converging rays Diverging rays Converging Lens Ray tracing rules Image formation Diverging Lens Ray tracing Image formation

More information

EXTERNAL INQUIRIES. Objective of Section: Definition: Rating:

EXTERNAL INQUIRIES. Objective of Section: Definition: Rating: EXTERNAL INQUIRIES 7 Objective of Section: Describe and define the concepts necessary to identify and rate External Inquiries. The exercises at the end of the section help the student demonstrate that

More information

Exam Datastrukturer. DIT960 / DIT961, VT-18 Göteborgs Universitet, CSE

Exam Datastrukturer. DIT960 / DIT961, VT-18 Göteborgs Universitet, CSE Exam Datastrukturer DIT960 / DIT961, VT-18 Göteborgs Universitet, CSE Day: 2017-05-31, Time: 8:30-12.30, Place: SB-MU Course responsible Alex Gerdes, tel. 031-772 6154. Will visit at around 9:30 and 11:00.

More information

Lines and Planes in 3D

Lines and Planes in 3D Lines and Planes in 3D Philippe B. Laval KSU January 28, 2013 Philippe B. Laval (KSU) Lines and Planes in 3D January 28, 2013 1 / 20 Introduction Recall that given a point P = (a, b, c), one can draw a

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

Arrays Structured data Arrays What is an array?

Arrays Structured data Arrays What is an array? The contents of this Supporting Material document have been prepared from the Eight units of study texts for the course M150: Date, Computing and Information, produced by The Open University, UK. Copyright

More information

Microsoft Excel Pivot Tables & Pivot Table Charts

Microsoft Excel Pivot Tables & Pivot Table Charts Microsoft Excel 2013 Pivot Tables & Pivot Table Charts A pivot table report allows you to analyze and summarize a million rows of data in Excel 2013 without entering a single formula. Pivot Tables let

More information

Escher s Tessellations: The Symmetry of Wallpaper Patterns II. Symmetry II

Escher s Tessellations: The Symmetry of Wallpaper Patterns II. Symmetry II Escher s Tessellations: The Symmetry of Wallpaper Patterns II Symmetry II 1/38 Brief Review of the Last Class Last time we started to talk about the symmetry of wallpaper patterns. Recall that these are

More information

Data Structures and Algorithms Key to Homework 1

Data Structures and Algorithms Key to Homework 1 Data Structures and Algorithms Key to Homework 1 January 31, 2005 15 Define an ADT for a set of integers (remember that a set may not contain duplicates) Your ADT should consist of the functions that can

More information

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question Page 1 of 6 Template no.: A Course Name: Computer Programming1 Course ID: Exam Duration: 2 Hours Exam Time: Exam Date: Final Exam 1'st Semester Student no. in the list: Exam pages: Student's Name: Student

More information

June 10, Dear Students and Parents,

June 10, Dear Students and Parents, June 10, 2015 Dear Students and Parents, Hello and welcome from the Beaumont Math Department! My name is Mr. Hass-Hill and will I teach all of Beaumont s College Prep Algebra I and Honors Algebra I courses

More information

Lab 5. Using Fpro SoC with Hardware Accelerators Fast Sorting

Lab 5. Using Fpro SoC with Hardware Accelerators Fast Sorting Lab 5 Using Fpro SoC with Hardware Accelerators Fast Sorting Design, implement, and verify experimentally a circuit shown in the block diagram below, composed of the following major components: FPro SoC

More information

Sets: Efficient Searching and Insertion

Sets: Efficient Searching and Insertion Sets: Efficient Searching and Insertion PIC 10B May 18, 2016 PIC 10B Sets: Efficient Searching and Insertion May 18, 2016 1 / 9 Overview of Lecture 1 Searching and Inserting 2 Sets 3 Questions PIC 10B

More information

Control Structures II. Repetition (Loops)

Control Structures II. Repetition (Loops) Control Structures II Repetition (Loops) Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1 to 100 The answer will be 1 + 2 + 3 + 4 + 5 + 6 + +

More information

Student Outcomes. Lesson Notes. Classwork. Discussion (4 minutes)

Student Outcomes. Lesson Notes. Classwork. Discussion (4 minutes) Student Outcomes Students write mathematical statements using symbols to represent numbers. Students know that written statements can be written as more than one correct mathematical sentence. Lesson Notes

More information

Motivations. Chapter 5: Loops and Iteration. Opening Problem 9/13/18. Introducing while Loops

Motivations. Chapter 5: Loops and Iteration. Opening Problem 9/13/18. Introducing while Loops Chapter 5: Loops and Iteration CS1: Java Programming Colorado State University Original slides by Daniel Liang Modified slides by Chris Wilcox Motivations Suppose that you need to print a string (e.g.,

More information

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu Physics 2660: Fundamentals of Scientific Computing Lecture 5 Instructor: Prof. Chris Neu (chris.neu@virginia.edu) Reminder I am back! HW04 due Thursday 22 Feb electronically by noon HW grades are coming.

More information

CS 137 Part 7. Big-Oh Notation, Linear Searching and Basic Sorting Algorithms. November 10th, 2017

CS 137 Part 7. Big-Oh Notation, Linear Searching and Basic Sorting Algorithms. November 10th, 2017 CS 137 Part 7 Big-Oh Notation, Linear Searching and Basic Sorting Algorithms November 10th, 2017 Big-Oh Notation Up to this point, we ve been writing code without any consideration for optimization. There

More information

COSC 311: ALGORITHMS HW1: SORTING

COSC 311: ALGORITHMS HW1: SORTING COSC 311: ALGORITHMS HW1: SORTIG Solutions 1) Theoretical predictions. Solution: On randomly ordered data, we expect the following ordering: Heapsort = Mergesort = Quicksort (deterministic or randomized)

More information

COMMERCIAL BANKING. ChAsE COMMERCIAL ONLINE sm ALERTs ACTIvATE ALERTs. Step. Step 2. From the My Accounts page, click "Manage Account Alerts.

COMMERCIAL BANKING. ChAsE COMMERCIAL ONLINE sm ALERTs ACTIvATE ALERTs. Step. Step 2. From the My Accounts page, click Manage Account Alerts. ChAsE COMMERCIAL ONLINE sm ALERTs ACTIvATE ALERTs You can enroll in Account Alerts through Chase Commercial Online. Alerts provide you with notifications through email messages or push notifications to

More information

Lesson B Objectives IF/THEN. Chapter 4B: More Advanced PL/SQL Programming

Lesson B Objectives IF/THEN. Chapter 4B: More Advanced PL/SQL Programming Chapter 4B: More Advanced PL/SQL Programming Monday 2/23/2015 Abdou Illia MIS 4200 - Spring 2015 Lesson B Objectives After completing this lesson, you should be able to: Create PL/SQL decision control

More information

Arrays. Array Basics. Chapter 8 Spring 2017, CSUS. Chapter 8.1

Arrays. Array Basics. Chapter 8 Spring 2017, CSUS. Chapter 8.1 Arrays Chapter 8 Spring 2017, CSUS Array Basics Chapter 8.1 1 Array Basics Normally, variables only have one piece of data associated with them An array allows you to store a group of items of the same

More information

Data Structures and Algorithms in Java. Second Year Software Engineering

Data Structures and Algorithms in Java. Second Year Software Engineering Data Structures and Algorithms in Java Second Year Software Engineering Introduction Computer: is a programmable machine that can store, retrieve and process data. Data: The representation of information

More information

High Dimensional Indexing by Clustering

High Dimensional Indexing by Clustering Yufei Tao ITEE University of Queensland Recall that, our discussion so far has assumed that the dimensionality d is moderately high, such that it can be regarded as a constant. This means that d should

More information

Hot X: Algebra Exposed

Hot X: Algebra Exposed Hot X: Algebra Exposed Solution Guide for Chapter 11 Here are the solutions for the Doing the Math exercises in Hot X: Algebra Exposed! DTM from p.149 2. Since m = 2, our equation will look like this:

More information

Chapter 4 Loops. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved.

Chapter 4 Loops. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. Chapter 4 Loops 1 Motivations Suppose that you need to print a string (e.g., "Welcome to Java!") a hundred times. It would be tedious to have to write the following statement a hundred times: So, how do

More information

Repetition and Loop Statements Chapter 5

Repetition and Loop Statements Chapter 5 Repetition and Loop Statements Chapter 5 1 Chapter Objectives To understand why repetition is an important control structure in programming To learn about loop control variables and the three steps needed

More information

CS4961 Parallel Programming. Lecture 12: Advanced Synchronization (Pthreads) 10/4/11. Administrative. Mary Hall October 4, 2011

CS4961 Parallel Programming. Lecture 12: Advanced Synchronization (Pthreads) 10/4/11. Administrative. Mary Hall October 4, 2011 CS4961 Parallel Programming Lecture 12: Advanced Synchronization (Pthreads) Mary Hall October 4, 2011 Administrative Thursday s class Meet in WEB L130 to go over programming assignment Midterm on Thursday

More information

COMP 465: Data Mining Classification Basics

COMP 465: Data Mining Classification Basics Supervised vs. Unsupervised Learning COMP 465: Data Mining Classification Basics Slides Adapted From : Jiawei Han, Micheline Kamber & Jian Pei Data Mining: Concepts and Techniques, 3 rd ed. Supervised

More information

Homework 3 Solutions

Homework 3 Solutions CS3510 Design & Analysis of Algorithms Section A Homework 3 Solutions Released: 7pm, Wednesday Nov 8, 2017 This homework has a total of 4 problems on 4 pages. Solutions should be submitted to GradeScope

More information

Introduction to Database Systems CSE 344

Introduction to Database Systems CSE 344 Introduction to Database Systems CSE 344 Lecture 6: Basic Query Evaluation and Indexes 1 Announcements Webquiz 2 is due on Tuesday (01/21) Homework 2 is posted, due week from Monday (01/27) Today: query

More information

MATH10001 Mathematical Workshop. Graphs, Trees and Algorithms Part 2. Trees. From Trees to Prüfer Codes

MATH10001 Mathematical Workshop. Graphs, Trees and Algorithms Part 2. Trees. From Trees to Prüfer Codes MATH10001 Mathematical Workshop Graphs, Trees and Algorithms Part 2 Trees Recall that a simple graph is one without loops or multiple edges. We are interested in a special type of simple graph: A tree

More information

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

Turn in a printout of your code exercises stapled to your answers to the written exercises at 2:10 PM on Thursday, January 13th. 6.189 Homework 3 Readings How To Think Like A Computer Scientist: Monday - chapters 9, 10 (all); Tuesday - Chapters 12, 13, 14 (all). Tuesday s reading will really help you. If you re short on time, skim

More information

Goal Management with Microsoft Outlook. Workbook

Goal Management with Microsoft Outlook. Workbook KELLY PAPER Goal Management with Microsoft Outlook Workbook Microsoft Outlook Tasks can help simplify defining and then prioritizing your goals into executable actions to move you ahead in the task completion

More information