Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.

Slides:



Advertisements
Similar presentations
Review Pseudo Code Basic elements of Pseudo code
Advertisements

Create and Manage Assignees Task Definition: Select and save a default person who will be getting your cart and completing the order process – known as.
Lesson 1.3 Unit 1, Lesson 3. Set:A collection of distinct objects Elements:All of the objects that make up a set.
MATH 224 – Discrete Mathematics
One Dimensional Arrays
Analysis of Algorithms CS Data Structures Section 2.6.
SEARCHING, SORTING, TOPOLOGICAL SORTS Most real world computer applications deal with vast amounts of data. Searching for a particular data item can take.
Sorting Algorithms. Motivation Example: Phone Book Searching Example: Phone Book Searching If the phone book was in random order, we would probably never.
CS107 Introduction to Computer Science Lecture 5, 6 An Introduction to Algorithms: List variables.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
CSC 1701B Computing: Science and Creativity. Outline  Types  Variables  Operators  Control: sequence, selection, repetition  Functions (block headings.
COMPUTER SCIENCE FEBRUARY 2011 Lists in Python. Introduction to Lists Lists (aka arrays): an ordered set of elements  A compound data type, like strings.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
Lecture No.01 Data Structures Dr. Sohail Aslam
Information and Computer Sciences University of Hawaii, Manoa
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
ดร.สุรศักดิ์ มังสิงห์ SPU, Computer Science Dept.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
SCHOOLOGY. Click on Sign Up Choose Instructor Fill Out Form / Register o Use SCHOOL address Fill in Country / State / and type.
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
CSC 205 Programming II Lecture 22 Carwash Simulation.
Outlook Web App Crash course. Outlook Agenda Login Login Reset Password Reset Password Getting Started in Outlook Web App Getting Started in Outlook Web.
Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Can’t provide fast insertion/removal and fast lookup at the same time Vectors, Linked Lists, Stack, Queues, Deques 4 Data Structures - CSCI 102 Copyright.
Introduction to C++ Programming Language Assistant Professor Jeon, Seokhee Assistant Professor Department of Computer Engineering, Kyung Hee University,
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Review Sorting algorithms Selection Sort Insertion Sort Bubble Sort Merge Sort Quick Sort.
2 Obaid Ullah HOD Computer Science Dept. Superior University Sialkot Campus.
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
Simple algorithms on an array - compute sum and min.
RVLL.Net Training Guide Pg Logging in Pg Going to your team page Pg – Verifying your team roster is complete Pg. 11 – Sending Message.
COMMISSIONS INC DEMO Log into system with name and password.
Copyright © 2014 Curt Hill Algorithms From the Mathematical Perspective.
Stacks. What is a Stack? A stack is a type of data structure (a way of organizing and sorting data so that it can be used efficiently). To be specific,
14-1 Computing Fundamentals with C++ Object-Oriented Programming and Design, 2nd Edition Rick Mercer Franklin, Beedle & Associates, 1999 ISBN
Click to edit Master text styles Stacks Data Structure.
EduBrite Training for Group Admins. Dashboard Reports Groups Enrolled courses More items under this menu.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
Structured Query Language used for defining and manipulating data in Relational DBs aimed at: –reducing training costs –increasing productivity –improve.
(and soon you will too) Presented by: Elizabeth Leimbach
CSC317 Selection problem q p r Randomized‐Select(A,p,r,i)
Lecture 5 of Computer Science II
Data Structures I (CPCS-204)
Arrays.
Design & Analysis of Algorithm Priority Queue
Containers and Lists CIS 40 – Introduction to Programming in Python
Efficiency of in Binary Trees
Chapter 8 Arrays Objectives
Prepared by Rao Umar Anwar For Detail information Visit my blog:
Data Structures 1 1.
Hash table another data structure for implementing a map or a set
PROBLEM SOLVING CSC 111.
Chapter 8 Arrays Objectives
CIS16 Application Development and Programming using Visual Basic.net
Data Structures – 1D Lists
Variability 8/24/04 Paul A. Jensen
Sorting … and Insertion Sort.
Arrays .
Chapter 8 Arrays Objectives
Visit for more Learning Resources
Computing Spans Given an an array X, the span S[i] of X[i] is
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
CSCS-200 Data Structure and Algorithms
Program: Mini Phone Book 2/11/2016
Introduction to Computer Science
Presentation transcript:

Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity

We often need to store a collection of items Snap ! has the list block Found under Variables The following list has 3 elements It is considered an anonymous list as it has no nameno name LISTS 2

By default, a list has 1 item that is an empty word To create an empty list, click the left arrow to remove it NEW LISTS CAN HAVE ONE NOTHING ITEM 3

A NAMED LIST WITH 3 ELEMENTS 4 Code demo: Give a name to an “empty” list, add 3 names Show all, first, last, and any element in the list known as names names is a list with 0 elements

TIME MAGAZINE ARTICLE Many years ago, an historian asked me to come up with a list of random numbers, from 1 to 100 I used Turbo Pascal to do this, it took about 5 minutes because Turbo Pascal has a pseudo random number generator, like Snap ! does The list was then used to select from a list of the top 100 historians who would then supplied their top 5 list of the worst presidents in U.S. history Ronald Reagan made the list of the 5 worst presidents in a Time Magazine article My colleague received death threats and left Penn State Code demo: Create a custom block to return a list of random integers

ONE SOLUTION 6

You list of phone contacts List of s Your registered courses Your transcript A top ten list The list of movies in your NetFlix queue List of all addresses for the newspaper delivery person This list Snap list of lists Each element in a list is another list LISTS ARE USED EVERYWHERE 7

A SNAP! LIST OF LISTS 8

A lot of computer time is spent Searching for an item in a list Sorting a list SEARCHING AND SORTING LISTS 9

A data type is first class in a programming language if data of that type can be all of the following: the value of a variable an input to a block the value returned by a block a member of a data aggregate: we can have a list of lists anonymous (not named) Snap lists are first class types! LISTS ARE FIRST CLASS TYPES 10

Average of a list of numbers input to a block Set sum to 0 For every element in the list Add the item to sum report sum / length of the list ALGORITHM: AVERAGE OF A LIST OF NUMBERS 11

Minimum word of a list input to a block Set min to the first item in the list For every element in the list If that item is less than the min Change min report min Write a Snap block that does this ALGORITHM: FIND THE ALPHABETICALLY FIRST WORD 12