27
1 Math 140 Data Structures and Algorithms Course Overview Lecture # 00 01/20/15 ‘N’ ‘E’ ‘M’ ‘O’ ‘N’ ‘E’ ‘M’ ‘O’ ‘N’ ‘N’ ‘E’ ‘E’ ‘M’ ‘M’ ‘O’ ‘O’ ‘N’ ‘M’ ‘O’ ‘N’ ‘M’ ‘M’ ‘O’ ‘N’ ‘E’ ‘M’ ‘O’ ‘N’ ‘N’ ‘E’ ‘E’ ‘M’ ‘M’ ‘O’ ‘O’

1 Math 140 Data Structures and Algorithms Course Overview Lecture # 00 01/20/15

Embed Size (px)

Citation preview

1

Math 140Data Structures and Algorithms

Course OverviewLecture # 00

01/20/15

‘N’ ‘E’ ‘M’ ‘O’‘N’ ‘E’ ‘M’ ‘O’‘N’‘N’ ‘E’‘E’ ‘M’‘M’ ‘O’‘O’

‘N’ ‘M’ ‘O’‘N’ ‘M’‘M’ ‘O’

‘N’ ‘E’ ‘M’ ‘O’‘N’‘N’ ‘E’‘E’ ‘M’‘M’ ‘O’‘O’

Bruce Smith
Good material, but insufficient in amount. Class was supposed to be from 12-1:15 and 1:25 to 2:15p, but this class seemed to be better trained and to need less help. For next semester, the class should start with an assessment of what they know. (What would that look like?) As is, this is probably 30 minutes short.

Overview

• Syllabus• The Importance of Data Structures and

Algorithms• Review of Java• Preparing for projects

Eclipse/Netbean exercises Code style conventions

4

M140 Course Description

• Intermediate course in computer science Training in program design and

development. Introduction to data structures:

• lists, stacks, queues, trees, and graphs. Implementation and analysis of

important algorithms and design patterns:

• recursion, divide and conquer, dynamic programming, sorting, and searching algorithms

5

Math 140

• Meeting Times Lecture:

• Tue, Thu: 12:00 pm - 1:15 pm, rm 394 Lab:

• Tue, Thu: 1:25 pm - 2:40 pm, rm 394

• Class Webpages: swccd.blackboard.com swccd.edu/~bsmith dept.swccd.edu/bsmith www.cs.princeton.edu/algs4

6

Instructor Contact Info

Bruce Smith, Prof. of Mathematics Phone: 421-6700, x5291 E-mail: [email protected] Office: room 390d Office hours:

• M,W: 8 am – 8:50 am

• M: 12 pm – 12:50 pm

– You can also contact me to setup an appointment outside these hours!

7

Textbook and Materials

• Required: Algorithms, Fourth Edition, by Robert Sedgewick

• On-line reference: docs.oracle.com/javase www.cs.princeton.edu/algs4

• External storage device req’d eg, USB flash drive

10

Evaluation Policy

• Semester Grade

Evaluation Policy

Quizzes (~9) 40%

Projects (~6) 20%

Midterm (1) 20%

Final Exam 20%

Total: 100%

course grade = 0.4* avg_quiz + 0.2 * avg_proj + 0.2* avg_exam + 0.2* final_exam

course grade = 0.4* avg_quiz + 0.2 * avg_proj + 0.2* avg_exam + 0.2* final_exam

excuse reducer: lowest quiz dropped

Attendance

• You can be dropped if you have more than 4 absences

• Tardiness and early departures may also be counted as absences

• Lowest quiz dropped for those with fewer than 4 absences and class participation if absent for a quiz , these will be your “freebies.”

• Student: “My friend is getting married and I have to miss class next week. Can I make up the exam?”

• Me: “Enjoy the wedding. If there’s a quiz that you missed, then this will be your freebie. No makeups allowed.”

Projects

• Assignments are submitted via Blackboard

• All assignments MUST be submitted as a .zip compressed file. You should generally submit ONE item:

• a .zip that contains everything.

• Your name should be present in each file you submit

15

Labs

• Same room as lecture, rm 394• Posted on Blackboard• Submitted via Blackboard• Work on projects, quizzes, exams,

and case studies. Also, lab time may extend lecture material.

• Attendance is required

16

DSS

• Please see me within the first 2 weeks of class if there are special needs

• Or call DSS at Voice: (619) 482-6512 TTY: (619) 482-6740.

17

Class Policies

• No food or drink (water bottles OK)• Cell phones silent• No children or visitors without prior

permission• Lab computers are for class-related

work.

18

Class Policies

• “penalty grades” If you are found cheating or helping someone cheat,

you may receive as much as (–)50% of the assignment’s value

• Students (both the giver and the receiver) involved in cheating and/or plagiarism will receive a “penalty grade” on the assignment and, at the discretion of the instructor, earn a failing grade in the class. Also see SWC Course Catalog regarding student

conduct.

Algorithms (run this on codepad.org)

• Efficiency of algorithms: linear search vs binary search ~N vs ~lg Nstatic int search(int a[], int v, int l, int r) { int m = (l+r)/2; while (r >= l) { if (v == a[m]) return m; if (v < a[m])

r = m-1; else

l = m+1; } return -1; }

Data Structures

• Arrays• Linked Lists• Trees• Graphs

21

Fundamental concepts of OOP

• object• class• method• parameter• data type

22

Demo:

• Using BlueJ to explore objects

Bruce Smith
skipped the BlueJ Demo

23

Objects and classes

• objects represent ‘things’ from the real world, or

from some problem domain (example: “the red car down there in the car park”)

• classes represent all objects of a kind (example:

“car”)

24

Methods and parameters

• Objects have operations which can be invoked (Java calls them methods).

• Methods may have parameters to pass additional information needed to execute.

25

Other observations

• Many instances can be created from a single class.

• An object has attributes: values stored in fields.

• The class defines what fields an object has, but each object stores its own set of values (the state of the object).

26

State

27

Two circle objects

the power of Eclipse

• create a Name class instance variables: first, last “setty” and “getty” methods

• mutators and accessors main() to use/test the methods

Lab Work

• File I/O and arrays practice code to read and

write files given a file of 100,000 numbers,

find the average value

http://www.swccd.edu/~bsmith/Files/Day01Lab.txt

Bruce Smith
did not cover due to time