CSCI 136 Data Structures & Advanced Programming. Fall 2018 Instructors Bill Lenhart & Bill Jannen

Similar documents
CSCI 136 Data Structures & Advanced Programming. Spring 2018 Instructors Bill Jannen & Jon Park

CSCI 136 Data Structures & Advanced Programming. Fall 2018 Instructors Bill Lenhart & Bill Jannen

Computer Science 210: Data Structures

Announcements. 1. Forms to return today after class:

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

Computer Science II Data Structures

CS 11 java track: lecture 1

Course: Honors AP Computer Science Instructor: Mr. Jason A. Townsend

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

Lec 3. Compilers, Debugging, Hello World, and Variables

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

last time in cs recitations. computer commands. today s topics.

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Java is an objet-oriented programming language providing features that support

CS 231 Data Structures and Algorithms, Fall 2016

CS 101 Fall 2006 Midterm 1 Name: ID:

CS 101 Spring 2007 Midterm 2 Name: ID:

CS1 Lecture 3 Jan. 18, 2019

CS 111X - Fall Test 1

CSCI 136 Data Structures & Advanced Programming. Lecture 3 Fall 2017 Instructors: Bill & Bill

Lecture 1. Course Overview, Python Basics

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

MPATE-GE 2618: C Programming for Music Technology. Syllabus

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

CSCI 136 Data Structures & Advanced Programming. Lecture 14 Fall 2018 Instructor: Bills

CS111: Intro to Computer Science

Lecture 1. Course Overview, Python Basics

Introduction to Data Structures

CS 106 Introduction to Computer Science I

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims

Announcements. Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment

Join the course group CS230-S18! Post questions, answer them if you know the answer!

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

Lecture 1. Course Overview Types & Expressions

AP Computer Science AB

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

H212 Introduction to Software Systems Honors

ESc101 : Fundamental of Computing

CSCI 136 Data Structures & Advanced Programming. Lecture 3 Fall 2018 Instructors: Bill & Bill

CS 241 Data Organization using C

CS 1803 Pair Homework 3 Calculator Pair Fun Due: Wednesday, September 15th, before 6 PM Out of 100 points

CS11 Java. Fall Lecture 1

CSCI 136 Data Structures & Advanced Programming. Lecture 12 Fall 2018 Profs Bill & Jon

Outline. Logistics. Logistics. Principles of Software (CSCI 2600) Spring Logistics csci2600/

Programming Languages and Techniques (CIS120)

CSE 240 Introduction to Computer Architecture

CS2013 Course Syllabus Spring 2018 Lecture: Mon/Wed 2:00 P.M. 2:50 P.M. SH C259 Lab: Mon/Wed 2:50 P.M. 4:00 P.M. SH C259

Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11

W13:Homework:H08. CS40 Foundations of Computer Science W13. From 40wiki

Programming Languages and Techniques (CIS120)

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

CS302: Fundamental Algorithms (and Data Structures)

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

COMP-202. Recursion. COMP Recursion, 2011 Jörg Kienzle and others

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

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

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

CS457/557 Functional Languages

Introduction to Computation and Problem Solving

CS 206 Introduction to Computer Science II

CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 2 Assigned: September 7, 2016 Due: Wednesday, September 14, 2016 by 2:30 pm

PROGRAMMING FUNDAMENTALS

CS 111X - Fall Test 1 - KEY KEY KEY KEY KEY KEY KEY

COMP Data Structures

CS 241 Data Organization. August 21, 2018

B. Knowledge of basic algebra and experience in problem solving is beneficial. Students should also possess competence in written communication.

CS 101 Fall 2005 Midterm 2 Name: ID:

COMP Data Structures

by the evening of Tuesday, Feb 6

Software Practice 1 Basic Grammar

Algorithms & Datastructures Laboratory Exercise Sheet 1

Lecture 1: Overview of Java

Data Structures and Algorithms

More on Arrays CS 16: Solving Problems with Computers I Lecture #13

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6

Boca Raton Community High School AP Computer Science A - Syllabus 2009/10

CS61C Machine Structures. Lecture 3 Introduction to the C Programming Language. 1/23/2006 John Wawrzynek. www-inst.eecs.berkeley.

CS Week 2. Jim Williams, PhD

Introduction to Python

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

CS 101 Fall 2006 Midterm 3 Name: ID:

Course Outline. Introduction to java

Welcome to CSE 326: Data Structures & Algorithms

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

Lecture 1. Types, Expressions, & Variables

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Fundamentals of Programming CS-110. Lecture 2

Lecture 1: Overview & Intro to Java

Introduction Basic elements of Java

CS 1110, LAB 1: EXPRESSIONS AND ASSIGNMENTS First Name: Last Name: NetID:

CSCI 1060U Programming Workshop

CS1 Lecture 3 Jan. 22, 2018

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment.

VE281 Data Structures and Algorithms. Introduction and Asymptotic Algorithm Analysis

Object Oriented Programming and Design in Java. Session 2 Instructor: Bert Huang

Introduction to Computer Systems

Welcome to CompSci 201

Topic 4 Expressions and variables

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division. SECOND SEMESTER Course Handout Part II

Transcription:

CSCI 136 Data Structures & Advanced Programming Fall 2018 Instructors Bill Lenhart & Bill Jannen

Administrative Details Class roster: Who s here? And who s trying to get in? Handout: Class syllabus Lecture location: TPL 205 Lab: Wed 12-2 or 2-4 (go to assigned lab!) Lab location: TCL 217a (Lenhart) & 216 (Jannen) Lab entry code: I hope you memorized it! Course Webpage: http://cs.williams.edu/~cs136/index.html 2

Today s Outline Course Preview Course Bureaucracy Java (re)fresher Part 1 3

Why Take CS136? To learn about: Data Structures Effective ways to store and manipulate data Advanced Programming Use structures and techniques to write programs that solve interesting and important problems Basics of Algorithm Analysis Measuring algorithm complexity Determining algorithm correctness 4

Squad * Goals Identify basic data structures list, stack, array, tree, graph, hash table, and more Implement these structures in Java Learn how to evaluate and visualize data structures Linked lists and arrays both represent lists of items Different representations of data Different algorithms for manipulating/accessing/storing data Learn how to design larger programs that are easier to modify, extend, and debug Have fun! * Bill L has a teenage daughter... 5

Common Themes 1. Identify data for problem 2. Identify questions to answer about data 3. Design data structures and algorithms to answer questions correctly and efficiently (Note: not all correct solutions are efficient, and vice versa!) 4. Implement solutions that are robust, adaptable, and reusable Example: Shortest Paths in Networks 6

7

Finding Shortest Paths The data: road segments Road segment: Source, destination, length (weight) The question Given source and destination, compute the shortest path from source The algorithm: Dijkstra s Algorithm The data structures (spoiler alert!) Graph: holds the road network in some useful form Priority Queue: holds not-yet-inspected edges Also uses: Lists, arrays, stacks,... A quick demo. 8

Course Outline Java review Basic structures Lists, vectors, queues, stacks Advanced structures Graphs, heaps, trees, dictionaries Foundations (throughout semester) Vocabulary Analysis tools Recursion & Induction Methodology 9

Syllabus Highlights How to contact us Bill Lenhart (TPL 304) Office hours: Tues & ThursM/T/Th 2:00-3:50pm; T: 9:00-10:00 mailto:wlenhart@williams.edu Bill Jannen (TCL 306) Office hours: mailto:jannen@cs.williams.edu Textbook Java Structures: Data Structures in Java for the Principled Programmer, Ö7 Edition (by Duane Bailey) Take one: You re already paying for it! Weekly labs, problem sets, mid-term & final exams... 10

Honor Code and Ethics College Honor Code and Computer Ethics guidelines can be found here: https://sites.williams.edu/honor-system/ https://oit.williams.edu/policies/ethics/ You should also know the CS Department computer usage policy. https://csci.williams.edu/the-cs-honor-code-and-computer-usage-policy/ If you are not familiar with these items, please review them. We take these things very seriously 11

Your Responsibilities Come to lab and lecture on time Read assigned material before class and lab Bring textbook to lab (or be prepared to use PDF) Bring paper/pen(cil) to lab for brain-storming, Come to lab prepared Bring design docs for program 1 Prof + 1TA == help for you: take advantage of this Do NOT accept (prolonged) confusion! Ask questions Your work should be your own. Unsure? Ask! Participate 12

Accounts and Passwords Mandatory: Before the first lab Talk to Mary Bailey about your CS account Mary manages our systems. She will be available Today: 9/7: Monday, 9/10: Tuesday, 9/11: Wednesday, 9/12: 1:00-2:15 pm 9:30-11:30 am, 3:00-4:30 pm 10:30 - noon, 3:00-4:30 pm 9:30-11:30 am Her office is in the 3 rd floor CS lab (TCL 312) Get this sorted out before lab on Wednesday! 13

Why Java? There are lots of programming languages C, Pascal, C++, Java, C#, Python Java was designed in 1990s to support Internet programming Why Java? It s easier (than predecessors like C++) to write correct programs Object-oriented good for large systems Good support for abstraction, extension, modularization Automatically handles low-level memory management Very portable 14

Why Not BlueJ? Learn to use Unix Command-line tools Emacs standard unix-based editor Emphasis will move from user interface programming to data structuring and efficient algorithm design Take advantage of opportunity to become Unix-savvy! 15

Java Review (Crash Course) 16

Java Variable types Primitive: int, double, boolean,... Object (class-based): String (special), Point, Jbutton,... Arrays 17

Java Statements int x; // declare variable x int x = 3; // declare & initialize x x = x + 1; x++; if (x > 3) { } else { } while (x < 2) { } for (int i = 0; i < x; i++) { } 18

Java Comments // this is a single-line comment /* this can span multiple lines */ Aside: good comments make code readable Explain the why not the what State assumptions or non-obvious logic return x+1; // returns sum of x+1 while (y < 2) /* continue as long * as y is < 2 */ 19

Primitive Types Provide numeric, character, and logical values 11, -23, 4.21, c, false Can be associated with a name (variable) Variables must be declared before use int age; // A simple integer value float speed; // A number with a decimal part char grade; // A single character bool loggedin; // Either true or false Variables can be initialized when declared int age = 21; float speed = 47.25; char grade = A ; bool loggedin = true; 20

Array Types Holds a collection of values of some type Can be of any type int[] ages; float[] speeds; char[] grades; bool[] loggedin; // An array of integeras // An array of floats // An array of characters // Either true or false Arrays can be initialized when declared int[] ages = { 21, 20, 19, 19, 20 }; float[] speeds = { 47.25, 3.4, -2.13, 0.0 }; char[] grades = { A, B, C, D }; bool[] loggedin = { true, true, false, true }; Or just created with a standard default value int[] ages = new int[15]; // array of 15 0s 21

Everything is a class Typically put the code for each class in a file with the same name as the class The Person class code would be in Person.java The method main is the entry point to a Java program main has a specific method signature: public static void main(string[] args) In grand CS tradition, we will write and run Hello.java 22

Simple Sample Programs Hello.java Write a program that prints Hello to the terminal. Now let s run it. Of Note: public static void main(string[] args){...} System.out is of type PrintStream javac and java commands 23