From Bing.com on Nov
|
|
- Donna Houston
- 5 years ago
- Views:
Transcription
1 Functions
2 From Bing.com on Nov
3 We re going to look at some common patterns / algorithms for using an array The idea is that you first understand these Then you can apply them elsewhere And modify them to suit 3
4 Arrays Patterns: 1 Item At A Time 4
5 Some array problems can be solved by considering each item, one by one, without thinking about the rest of the array Examples: Print each item Find a particular item in the array (or determine that it's not present) This uses the 'iterate through the array pattern Let s start with an overview of what each line of code is supposed to do 5
6 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { (1) var cars = ["Saab", "Volvo", "BMW"]; () var target = $("#findtarget").val(); // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message // after the loop $("#findoutput").html( "Did NOT find " + target + " in the array"); Start by defining an array (1), then get the string the user wants to search for (). 6
7 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; var target = $("#findtarget").val(); // Now convert the array to being a string so we can print it out onto the page: (1) for (i in cars) { () if( cars[i] == target) { (3) $("#findoutput").html( "Found " + target + " at array slot " + i ); (4) return; // stop searching, otherwise we'll print the 'not found' message // after the loop $("#findoutput").html( "Did NOT find " + target + " in the array"); (1) The for loop walks through all the indeces in the array (0, 1, ) () If the current slot is the one that we re looking for (3) Display a message on the page (4) And then stop 7
8 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; var target = $("#findtarget").val(); // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message // after the loop (1) $("#findoutput").html( "Did NOT find " + target + " in the array"); (1) If none of the elements match then we ll end up here 8
9 9 absent
10 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] Saab $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done Current Future 0 1 Saab Volvo BMW i 0 target absent 10
11 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] Volvo $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done Current 0 1 Saab Volvo BMW i 1 target Future absent 11
12 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] BMW $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done Current 0 1 Saab Volvo BMW i target absent Future 1
13 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] - $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done 0 1 Saab Volvo BMW i - target absent 13
14 14 present
15 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] Saab $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done Current Future 0 1 Saab Volvo BMW i 0 target Volvo 15
16 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findinarray").click( function() { var cars = ["Saab", "Volvo", "BMW"]; (1) var target = $("#findtarget").val(); () // Now convert the array to being a string so we can print it out onto the page: for (i in cars) { if( cars[i] == target) { cars[i] Volvo $("#findoutput").html( "Found " + target + " at array slot " + i ); return; // stop searching, otherwise we'll print the 'not found' message $("#findoutput").html( "Did NOT find " + target + " in the array"); Done Current 0 1 Saab Volvo BMW i 1 target Future Volvo 16
17 ICE #1: Parsons problems: Finding something in an array ICE #: Use this pattern to write new code printing everything in an array that matches a given criteria 17
18 Some array problems need to consider all the elements of the array, even though we see each one individually Examples: Find min/max calculate average concatenating / joining Difference in approach is that we retain, or persist, a value through multiple iterations of our loop. 18
19 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findminimum").click( function() { (1) var nums = [10, 0,, -4, -, 4] () var minimumidx = 0; (3) var minimumval = nums[0]; // check each element of the array to see if it's what we're looking for for (i in nums) { if( nums[i] < minimumval) { minimumidx = i; minimumval = nums[i]; $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Start by defining an array (1) We re going to look at the very first element first. Having only looked at the first element that means it must be the smallest that we ve seen so far. We re going to remember the smallest that we ve seen so far is at index 1 () We re going to remember the smallest value that we ve seen so far (3) 19
20 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -, 4] var minimumidx = 0; var minimumval = nums[0]; // check each element of the array to see if it's what we're looking for (1) for (i in nums) { () if( nums[i] < minimumval) { (3) minimumidx = i; (4) minimumval = nums[i]; $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); (1) We ll go through every slot in the array () If the slot we re currently looking at is less than the smallest value that we ve seen so far (3) Then remember this index (4) And remember this value, which is now the NEW smallest value that we ve seen so far 0
21 Here's what the 'main' / on click handler looks like for the FindInArray logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -, 4] var minimumidx = 0; var minimumval = nums[0]; // check each element of the array to see if it's what we're looking for for (i in nums) { if( nums[i] < minimumval) { minimumidx = i; minimumval = nums[i]; (1) $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); (1) Lastly, display the output on the page 1
22
23 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; minimumidx 0 var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumval 10 minimumidx = i; minimumval = nums[i]; i 0 $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); D o n e Current Future 4-3
24 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; minimumidx 0 var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumval 10 minimumidx = i; minimumval = nums[i]; i 0 $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); D o n e Current Future 4-4
25 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; minimumidx 0 var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumval 10 minimumidx = i; minimumval = nums[i]; i 1 $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
26 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; minimumidx 0 var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumval 10 minimumidx = i; minimumval = nums[i]; i $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
27 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; minimumidx var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumval minimumidx = i; minimumval = nums[i]; i $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
28 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumidx = i; minimumval = nums[i]; minimumidx minimumval i 3 $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
29 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumidx = i; minimumval = nums[i]; minimumidx minimumval i $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
30 Here's what the 'main' / on click handler looks like for the findminimum logic: $("#findminimum").click( function() { var nums = [10, 0,, -4, -] var minimumidx = 0; var minimumval = nums[0]; for (i in nums) { if( nums[i] < minimumval) { minimumidx = i; minimumval = nums[i]; minimumidx minimumval i $("#findminimumoutput").html( "Smallest value is " + nums[minimumidx]+ " (located at slot " + minimumidx + " in the array)"); Done Current Future
31 ICE #3: More Parsons problems ICE #4: Use this pattern to write new code 31
32 Arrays can also be used to maintain ordered lists In one such ordering array[0] is considered the bottom of the stack. You can push a new element onto the top of the stack Or pop the top element off the stack last 1 0 last 1 0 3
LR Parsing E T + E T 1 T
LR Parsing 1 Introduction Before reading this quick JFLAP tutorial on parsing please make sure to look at a reference on LL parsing to get an understanding of how the First and Follow sets are defined.
More informationDiscussion 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
More information2/6/2018. Let s Act Like Compilers! ECE 220: Computer Systems & Programming. Decompose Finding Absolute Value
University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Let s Act Like Compilers! Let s have some fun! Let s pretend to be a C compiler!
More informationOutline: Search and Recursion (Ch13)
Search and Recursion Michael Mandel Lecture 12 Methods in Computational Linguistics I The City University of New York, Graduate Center https://github.com/ling78100/lectureexamples/blob/master/lecture12final.ipynb
More informationParsing Scheme (+ (* 2 3) 1) * 1
Parsing Scheme + (+ (* 2 3) 1) * 1 2 3 Compiling Scheme frame + frame halt * 1 3 2 3 2 refer 1 apply * refer apply + Compiling Scheme make-return START make-test make-close make-assign make- pair? yes
More informationAlgorithm Design and Recursion. Search and Sort Algorithms
Algorithm Design and Recursion Search and Sort Algorithms Objectives To understand the basic techniques for analyzing the efficiency of algorithms. To know what searching is and understand the algorithms
More informationIntro. Scheme Basics. scm> 5 5. scm>
Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if
More informationOutputs. Inputs. the point where the graph starts, as we ll see on Example 1.
We ve seen how to work with functions algebraically, by finding domains as well as function values. In this set of notes we ll be working with functions graphically, and we ll see how to find the domain
More informationNeo4J: Graph Database
February 24, 2013 Basics is a data storage and query system designed for storing graphs. Data as a series of relationships, modelled as a directed graph. Recall, a graph is a pair of sets: G(V, E) vertices
More informationNote that for recursive descent to work, if A ::= B1 B2 is a grammar rule we need First k (B1) disjoint from First k (B2).
LL(k) Grammars We need a bunch of terminology. For any terminal string a we write First k (a) is the prefix of a of length k (or all of a if its length is less than k) For any string g of terminal and
More informationLab 7 1 Due Thu., 6 Apr. 2017
Lab 7 1 Due Thu., 6 Apr. 2017 CMPSC 112 Introduction to Computer Science II (Spring 2017) Prof. John Wenskovitch http://cs.allegheny.edu/~jwenskovitch/teaching/cmpsc112 Lab 7 - Using Stacks to Create a
More informationExample 1: Use the graph of the function f given below to find the following. a. Find the domain of f and list your answer in interval notation
When working with the graph of a function, the inputs (the elements of the domain) are always the values on the horizontal ais (-ais) and the outputs (the elements of the range) are always the values on
More informationDiscussion 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
More informationYou must include this cover sheet. Either type up the assignment using theory3.tex, or print out this PDF.
15-122 Assignment 3 Page 1 of 12 15-122 : Principles of Imperative Computation Fall 2012 Assignment 3 (Theory Part) Due: Thursday, October 4 at the beginning of lecture. Name: Andrew ID: Recitation: The
More informationProject Compiler. CS031 TA Help Session November 28, 2011
Project Compiler CS031 TA Help Session November 28, 2011 Motivation Generally, it s easier to program in higher-level languages than in assembly. Our goal is to automate the conversion from a higher-level
More informationAbstract Data Types Data Structure Grand Tour Java Collections.
Abstract Data Types Data Structure Grand Tour Java Collections http://gcc.gnu.org/onlinedocs/libstdc++/images/pbds_different_underlying_dss_1.png } Stacks and Queues Ideally, you have met with your partner
More informationEliminating Recursion (Optional)
Eliminating Recursion (Optional) Tail Recursion Optimization (optional) TAIL RECURSION n. See TAIL RECURSION. The Jargon File. Suppose we have a routine of the following form proceduref(p) varv ifethen
More informationAnnouncements. Project 5 is on the street. Second part is essay questions for CoS teaming requirements.
Announcements Project 5 is on the street. Second part is essay questions for CoS teaming requirements. The first part you do as a team The CoS essay gets individually answered and has separate submission
More informationCS2304: 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
More informationAbstract Data Types Data Structure Grand Tour Java Collections.
Abstract Data Types Data Structure Grand Tour Java Collections http://gcc.gnu.org/onlinedocs/libstdc++/images/pbds_different_underlying_dss_1.png } Stacks and Queues Ideally, you have met with your partner
More informationLab 4: Super Sudoku Solver CSCI 2101 Fall 2017
Due: Wednesday, October 18, 11:59 pm Collaboration Policy: Level 1 Group Policy: Pair-Optional Lab 4: Super Sudoku Solver CSCI 2101 Fall 2017 In this week s lab, you will write a program that can solve
More informationapplication components
What you need to know for Lab 1 code to publish workflow application components activities An activity is an application component that provides a screen with which users can interact in order to do something,
More informationMultidimensional Arrays & Graphs. CMSC 420: Lecture 3
Multidimensional Arrays & Graphs CMSC 420: Lecture 3 Mini-Review Abstract Data Types: List Stack Queue Deque Dictionary Set Implementations: Linked Lists Circularly linked lists Doubly linked lists XOR
More informationChecked and Unchecked Exceptions in Java
Checked and Unchecked Exceptions in Java Introduction In this article from my free Java 8 course, I will introduce you to Checked and Unchecked Exceptions in Java. Handling exceptions is the process by
More informationArrays. COMS W1007 Introduction to Computer Science. Christopher Conway 10 June 2003
Arrays COMS W1007 Introduction to Computer Science Christopher Conway 10 June 2003 Arrays An array is a list of values. In Java, the components of an array can be of any type, basic or object. An array
More informationCS261 Data Structures. Iterator ADT Dynamic Array and Linked List
CS261 Data Structures Iterator ADT Dynamic Array and Linked List Goals Why do we need iterators? Iterator ADT Linked List and Dynamic Array Iterators IteraAng through a Linked List Write a code segment
More informationDepending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.
1 SPSS 13.0 for Windows Introductory Assignment Material covered: Creating a new SPSS data file, variable labels, value labels, saving data files, opening an existing SPSS data file, generating frequency
More informationCISC-124. Casting. // this would fail because we can t assign a double value to an int // variable
CISC-124 20180122 Today we looked at casting, conditionals and loops. Casting Casting is a simple method for converting one type of number to another, when the original type cannot be simply assigned to
More informationSummer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define
CS 6A Scheme Summer 207 Discussion 0: July 25, 207 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,
More informationThe fringe of a binary tree are the values in left-to-right order. For example, the fringe of the following tree:
Lecture 13 The Same Fringe Problem Given a binary tree: sealed trait BinTree [+A] case class Node [A]( lhs : BinTree [A], rhs : BinTree [A]) extends BinTree [A] case class Leaf [A]( x: A) extends BinTree
More informationToday's Topics. Last Time Modelling Scopes and Visibility The Run Stack, the Dynamic Pointer Stack, the Display (LL,ON) addressing
Today's Topics Last Time Modelling Scopes and Visibility The Run Stack, the Dynamic Pointer Stack, the (LL,ON) addressing Today Maintaining the Kinds of parameters and parameter passing (LL,ON) Address
More informationWhen Swift met classic algorithms and data structures. Caveats & Tips
When Swift met classic algorithms and data structures Caveats & Tips Given an array of numbers, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
More informationSCHEME 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,
More informationCSCE 2014 Final Exam Spring Version A
CSCE 2014 Final Exam Spring 2017 Version A Student Name: Student UAID: Instructions: This is a two-hour exam. Students are allowed one 8.5 by 11 page of study notes. Calculators, cell phones and computers
More informationComputational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs
Computational Optimization ISE 407 Lecture 16 Dr. Ted Ralphs ISE 407 Lecture 16 1 References for Today s Lecture Required reading Sections 6.5-6.7 References CLRS Chapter 22 R. Sedgewick, Algorithms in
More informationDependent Independent Input Discrete. X Y Output Continuous
Domain and Range Review Vocabulary Words Dependent Independent Input Discrete X Y Output Continuous Domain is all the values. It is the variable. It is also the of the function. Range is all the values.
More informationDeviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded
Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded improvements to Unix. There are actually two fairly different
More informationLastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software.
Welcome to the EASE workshop series, part of the STEM Gateway program. Before we begin, I want to make sure we are clear that this is by no means meant to be an all inclusive class in Excel. At each step,
More informationCS261 Data Structures. Iterator ADT Dynamic Array and Linked List
CS261 Data Structures Iterator ADT Dynamic Array and Linked List Goals Why do we need iterators? Iterator ADT Linked List and Dynamic Array Iterators The lecture will focus on link list iterators Interface
More informationLECTURE 17 GRAPH TRAVERSALS
DATA STRUCTURES AND ALGORITHMS LECTURE 17 GRAPH TRAVERSALS IMRAN IHSAN ASSISTANT PROFESSOR AIR UNIVERSITY, ISLAMABAD STRATEGIES Traversals of graphs are also called searches We can use either breadth-first
More informationPython Activity 2: Input and Variables in Python
Python Activity 2: Input and Variables in Python "How do you input and store data in a Python program?" Learning Objectives Students will be able to: Content: Explain how to input data in Python Explain
More informationCS1150 Principles of Computer Science Methods
CS1150 Principles of Computer Science Methods Yanyan Zhuang Department of Computer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Colorado Springs Opening Problem Find the sum of integers from 1 to
More informationAdvanced Java Concepts Unit 3: Stacks and Queues
Advanced Java Concepts Unit 3: Stacks and Queues Stacks are linear collections in which access is completely restricted to just one end, called the top. Stacks adhere to a last-in, first-out protocol (LIFO).
More informationLesson Seven: Holding Gestures
Lesson Seven: Holding Gestures PAGE 01 Lesson Seven: Holding Gestures Overview In the previous lesson, we made our functions more useful by allowing them to output through the keyboard. By assigning different
More informationCS510 \ Lecture Ariel Stolerman
CS510 \ Lecture02 2012-10-03 1 Ariel Stolerman Midterm Evan will email about that after the lecture, at least 2 lectures from now. The exam will be given in a regular PDF (not an online form). We will
More informationThere are many other applications like constructing the expression tree from the postorder expression. I leave you with an idea as how to do it.
Programming, Data Structures and Algorithms Prof. Hema Murthy Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 49 Module 09 Other applications: expression tree
More informationProgramming in Android. Nick Bopp
Programming in Android Nick Bopp nbopp@usc.edu Types of Classes Activity This is the main Android class that you will be using. These are actively displayed on the screen and allow for user interaction.
More informationCreating a stacked bar chart
Creating a stacked bar chart In this tutorial we are going to create a stacked bar chart based on a sample report. Stacked bar charts are easy to read and can show an alternate view of the structure of
More informationCS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class
CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class One of the keys to writing good code is testing your code. This assignment is going to introduce you and get you setup to
More informationAssignment III: Graphing Calculator
Assignment III: Graphing Calculator Objective You will enhance your Calculator to create a graph of the program the user has entered which can be zoomed in on and panned around. Your app will now work
More informationWeb Application Development
Web Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie JavaScript JAVASCRIPT FUNDAMENTALS Agenda
More informationEnabling industry 4.0 Event-driven architectures and smart micro services
Enabling industry 4.0 Event-driven architectures and smart micro services Dr., Systems and control, Chalmers Chalmers, Automation +46 (0)768 979561 Kristofer.bengtsson@chalmers.se The key to industry 4.0
More informationStep I: ODBC Driver Set up
Step I: ODBC Driver Set up In order to connect to the Teradata data warehouse you must have a connection driver on your system. While there are different types of connections the most common is ODBC. If
More informationThis section provides some reminders and some terminology with which you might not be familiar.
Chapter 3: Functions 3.1 Introduction The previous chapter assumed that all of your Bali code would be written inside a sole main function. But, as you have learned from previous programming courses, modularizing
More informationMIPS Programming. A basic rule is: try to be mechanical (that is, don't be "tricky") when you translate high-level code into assembler code.
MIPS Programming This is your crash course in assembler programming; you will teach yourself how to program in assembler for the MIPS processor. You will learn how to use the instruction set summary to
More informationAssignment III: Graphing Calculator
Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator. By doing this, you will gain
More informationRecursion. Let s start by looking at some problems that are nicely solved using recursion. First, let s look at generating The Fibonacci series.
Recursion The programs we have discussed so far have been primarily iterative and procedural. Code calls other methods in a hierarchical manner. For some problems, it is very useful to have the methods
More informationExam 1. CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey
Exam 1 CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey I understand that this exam is closed books and closed notes and is to be completed without a calculator, phone, or other computer.
More informationRecursive Definitions
Recursion Objectives Explain the underlying concepts of recursion Examine recursive methods and unravel their processing steps Explain when recursion should and should not be used Demonstrate the use of
More informationWithout further ado, let s go over and have a look at what I ve come up with.
JIRA Integration Transcript VLL Hi, my name is Jonathan Wilson and I m the service management practitioner with NHS Digital based in the United Kingdom. NHS Digital is the provider of services to the National
More informationTHE JOY OF ENGINEERING
THE JOY OF ENGINEERING COMPUTER SCIENCE/COMPUTER ENGINEERING Michael Yan, Eric Leung, Binna Han Calc-E LAB 2 KEYBOARD.C int keyboard_key() // initlaize keyboard, reset every column to high keyboard_init();
More informationBasic Data Structures (Version 7) Name:
Prerequisite Concepts for Analysis of Algorithms Basic Data Structures (Version 7) Name: Email: Concept: mathematics notation 1. log 2 n is: Code: 21481 (A) o(log 10 n) (B) ω(log 10 n) (C) Θ(log 10 n)
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17 5.1 Introduction You should all know a few ways of sorting in O(n log n)
More informationFigure 1. A breadth-first traversal.
4.3 Tree Traversals Stepping, or iterating, through the entries of a linearly ordered list has only two obvious orders: from front to back or from back to front. There is no obvious traversal of a general
More informationComputer Architecture and System Software Lecture 07: Assembly Language Programming
Computer Architecture and System Software Lecture 07: Assembly Language Programming Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements New assembly examples uploaded to
More informationCSCI 204 Introduction to Computer Science II. Lab 6: Stack ADT
CSCI 204 Introduction to Computer Science II 1. Objectives In this lab, you will practice the following: Learn about the Stack ADT Implement the Stack ADT using an array Lab 6: Stack ADT Use a Stack to
More informationCSC201, SECTION 002, Fall 2000: Homework Assignment #1
1 of 6 11/8/2003 7:34 PM CSC201, SECTION 002, Fall 2000: Homework Assignment #1 DUE DATE Monday, September 11, at the start of class. INSTRUCTIONS FOR PREPARATION Neat, in order, answers easy to find.
More informationSolutions to Problem Set 1
CSCI-GA.3520-001 Honors Analysis of Algorithms Solutions to Problem Set 1 Problem 1 An O(n) algorithm that finds the kth integer in an array a = (a 1,..., a n ) of n distinct integers. Basic Idea Using
More information2. The histogram. class limits class boundaries frequency cumulative frequency
MA 115 Lecture 03 - Some Standard Graphs Friday, September, 017 Objectives: Introduce some standard statistical graph types. 1. Some Standard Kinds of Graphs Last week, we looked at the Frequency Distribution
More informationCS3205 HCI IN SOFTWARE DEVELOPMENT INTRODUCTION TO PROTOTYPING. Tom Horton. * Material from: Floryan (UVa) Klemmer (UCSD, was at Stanford)
CS3205 HCI IN SOFTWARE DEVELOPMENT INTRODUCTION TO PROTOTYPING Tom Horton * Material from: Floryan (UVa) Klemmer (UCSD, was at Stanford) READINGS ID Book. Chapter 11 in published book, Design, Prototyping,
More informationThank you for purchasing a ZT-1300 printer! The following guide will help you install the equipment and software that goes with your ZT-1300 printer.
Thank you for purchasing a ZT-1300 printer! The following guide will help you install the equipment and software that goes with your ZT-1300 printer. It is strongly recommended that you read through the
More information15-110: Principles of Computing, Spring 2018
15-110: Principles of Computing, Spring 2018 Programming Assignment 5 Due: Tuesday, February 27 by 9PM Note: You are responsible for protecting your solutions to the following problems from being seen
More informationLecture 24 Notes Search in Graphs
Lecture 24 Notes Search in Graphs 15-122: Principles of Imperative Computation (Spring 2016) Frank Pfenning, André Platzer, Rob Simmons, Penny Anderson 1 Introduction In this lecture, we will discuss the
More informationSpecial Section: Building Your Own Compiler
cshtp6_19_datastructures_compiler.fm Page 1 Tuesday, February 14, 2017 10:31 AM 1 Chapter 19 Special Section: Building Your Own Compiler In Exercises8.31 8.33, we introduced Simpletron Machine Language
More informationCQMS-MetricStream Initiating and Validating a Process Non-Conformance (PNC)
In a process failure is recorded as a Process Non- Conformance (PNC). You ll need to initiate your PNC by going to the MNC/PNC tab and using the My Forms area: Click here to begin 1 Whether your role is
More informationCS Introduction to Data Structures How to Parse Arithmetic Expressions
CS3901 - Introduction to Data Structures How to Parse Arithmetic Expressions Lt Col Joel Young One of the common task required in implementing programming languages, calculators, simulation systems, and
More informationThis tutorial will teach you about operators. Operators are symbols that are used to represent an actions used in programming.
OPERATORS This tutorial will teach you about operators. s are symbols that are used to represent an actions used in programming. Here is the link to the tutorial on TouchDevelop: http://tdev.ly/qwausldq
More informationINF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION. Instructors: Crista Lopes Copyright Instructors.
INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION Instructors: Crista Lopes Copyright Instructors. Topics Recursion Higher-order functions Continuation-Passing Style Monads (take 1) Identity Monad Maybe
More informationAdmin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return
Recursion CS 1 Admin How's the project coming? After these slides, read chapter 13 in your book Yes that is out of order, but we can read it stand alone Quizzes will return Tuesday Nov 29 th see calendar
More informationEasy Appointments V1.3.0
Easy Appointments V1.3.0 Copyright 2017 TALENTHUT www.talenthut.io 1. Welcome The Easy Appointments Siberian CMS module will easily allow you add an appointments booking engine to your App. The App manager
More informationEECE.4810/EECE.5730: Operating Systems Spring 2017 Homework 1 Solution Due 3:15 PM, Wednesday, 2/1/17
Spring 2017 Homework 1 Solution Due 3:15 PM, Wednesday, 2/1/17 1. (10 points) a. (3 points) Briefly describe the characteristics of zombie and orphan processes. Solution: A zombie process is a process
More informationWarmups! Write down & Plot the points on the graph
Warmups! Write down & Plot the points on the graph 1) 3,5 2) 2, 4 3) 3,6 4) 0,4 3.1-3.2 functions All you need to know about function and relations. 1 Goal: Understand relations and functions Review what
More informationStacks and Queues
Stacks and Queues 2-25-2009 1 Opening Discussion Let's look at solutions to the interclass problem. Do you have any questions about the reading? Do you have any questions about the assignment? Minute Essays
More informationStacks and Function Calls
Stacks and Function Calls Embedded Systems 3-1 Remember the Memory Map for Our MCU Embedded Systems 3-2 Classifying Data Variables Automatic declared within a function Only exist while the function executes
More informationReliable programming
Reliable programming How to write programs that work Think about reliability during design and implementation Test systematically When things break, fix them correctly Make sure everything stays fixed
More informationAPCS-AB: Java. Recursion in Java December 12, week14 1
APCS-AB: Java Recursion in Java December 12, 2005 week14 1 Check point Double Linked List - extra project grade Must turn in today MBCS - Chapter 1 Installation Exercises Analysis Questions week14 2 Scheme
More informationCREATE YOUR CONTENT STRATEGY & LAUNCH PLAN Amanda Genther Inc. & Irresistible Offerings
CREATE YOUR CONTENT STRATEGY & LAUNCH PLAN WHAT WE RE GOING TO TALK ABOUT» How to create content that entices your prospects to buy» How to create a content marketing plan that can be put on autopilot
More informationDesigning with OpenSCAD
Designing with OpenSCAD A Young Lady s First Enchiridion Wil Chung Designing with OpenSCAD A Young Lady s First Enchiridion Wil Chung This book is for sale at http://leanpub.com/designing_with_openscad
More informationJavaScript Introduction
JavaScript Introduction What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means
More informationWe can create PDAs with multiple stacks. At each step we look at the current state, the current input symbol, and the top of each stack.
Other Automata We can create PDAs with multiple stacks. At each step we look at the current state, the current input symbol, and the top of each stack. From all of this information we decide what state
More informationToday's Topics. CISC 458 Winter J.R. Cordy
Today's Topics Last Time Semantics - the meaning of program structures Stack model of expression evaluation, the Expression Stack (ES) Stack model of automatic storage, the Run Stack (RS) Today Managing
More informationCSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I
CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I Welcome to your CSCI-1100 Lab! In the fine tradition of the CSCI-1100 course, we ll start off the lab with the classic bad joke
More informationAlgorithms in Systems Engineering ISE 172. Lecture 16. Dr. Ted Ralphs
Algorithms in Systems Engineering ISE 172 Lecture 16 Dr. Ted Ralphs ISE 172 Lecture 16 1 References for Today s Lecture Required reading Sections 6.5-6.7 References CLRS Chapter 22 R. Sedgewick, Algorithms
More informationSearch and Sorting Algorithms
Fundamentals of Programming (Python) Search and Sorting Algorithms Sina Sajadmanesh Sharif University of Technology Some slides have been adapted from Python Programming: An Introduction to Computer Science
More informationAzure Active Directory and Microsoft Intune Setup for In- House ios version of Lookout for Work
Azure Active Directory and Microsoft Intune Setup for In- House ios version of Lookout for Work Purpose This document explains the steps necessary to: Set up the ios In-House version of Lookout for Work
More informationCSE 143. Lecture 4: Stacks and Queues
CSE 143 Lecture 4: Stacks and Queues Stacks and queues Sometimes it is good to have a collection that is less powerful, but is optimized to perform certain operations very quickly. Today we will examine
More informationCS201 Discussion 12 HUFFMAN + ERDOSNUMBERS
CS0 Discussion HUFFMAN + ERDOSNUMBERS Huffman Compression Today, we ll walk through an example of Huffman compression. In Huffman compression, there are three steps:. Create a Huffman tree. Get all the
More information1 ICS 161: Design and Analysis of Algorithms Lecture notes for January 23, Bucket Sorting
1 ICS 161: Design and Analysis of Algorithms Lecture notes for January 23, 1996 2 Bucket Sorting We ve seen various algorithms for sorting in O(n log n) time and a lower bound showing that O(n log n) is
More informationBinary Search Trees. See Section 11.1 of the text.
Binary Search Trees See Section 11.1 of the text. Consider the following Binary Search Tree 17 This tree has a nice property: for every node, all of the nodes in its left subtree have values less than
More informationAudience Analytics Data Submission Guide Current Participants
Audience Analytics Data Submission Guide Current Participants This material will guide you through the process of reviewing your current data in emerge and organizing, preparing, and uploading your new
More information