csc – 332 data structures dr. curry guinn. quick info dr. curry guinn –cis 2045...

26
CSC – 332 Data Structures Dr. Curry Guinn

Upload: diane-whitehead

Post on 01-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

CSC – 332 Data Structures

Dr. Curry Guinn

Page 2: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Quick Info

• Dr. Curry Guinn– CIS 2045– [email protected]– www.uncw.edu/people/guinnc– 962-7937– Office Hours: MTWR: 11:00am-12:00pm

and by appointment

Page 3: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

What is CSC 332?

• Data Structures– THE Gateway Course

• Gateway to most 300 and 400 level CSC courses• Gateway to our graduate CSC courses• Not just a gateway course at UNCW – it is the

pivotal course in all undergraduate computer science programs

Page 4: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Why Is It So Important?

• How you organize and access information on computers is fundamental

• Across disciplines within computer science the same sorts of operations arise again and again

• This course investigates the best practices of past scientists trying to solve those puzzles

Page 5: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

How To Approach This Course

Your future CSC courses and your future career in IT/Computers depends on

mastering this material.

Page 6: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

How Do I Earn an ‘A’?

• Read the books.• Come to every lecture. • Write programs.

– Turn in assignments on time.– Work independently – Every assignment must be submitted

(otherwise ‘F’).

• Make use of office hours– Send me email early and often.

Page 7: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Course and Grading Criteria

Quizzes 1/8

1st Midterm Exam 11/80

2nd Midterm Exam 11/80

Final 3/10

Homework 3/10 -10 pts. per day late up to 5 days. Then ‘F’ for the course

Page 8: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

The Required Texts

• Mark Allen Weiss, Data Structures and Algorithm Analysis in Java, Second or Third Edition.

• Douglas R. Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

Page 9: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Specific Goals of the Course

• Goal 1: Understand and Implement Data Structures That Have Found to Be Important and Particularly Useful

An example: Arrays

Why are arrays useful?

Page 10: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• What can you do with arrays?

• How do you find something in an array?

• How do we know which algorithm for finding something in an array is “better”?

• What does “better” mean in this context?– Analysis of algorithms

Page 11: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• When are arrays bad?

• Which leads us to linked lists, queues, and stacks

Page 12: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• Which leads us to sorting

• Some sorting algorithms depend on recursion so we’ll need to study that too

Page 13: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• Linked lists are not so good for searching and sorting

• Which leads us to binary trees

• Are binary search trees always better than a linked list?

Page 14: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• Which leads us to studying how to balance binary trees

• Are there other useful tree structures?

Page 15: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• Trees are a special type of graph.

• What problems lend themselves to being represented as a graph?

Page 16: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 1: Understanding Data Structures

• Linear search takes O(n) time

• Binary search takes log(n) time

• Hashing search takes 1 time!!!

• I wonder if there are any drawbacks?

Page 17: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Are there algorithm patterns that we see repeated?

• Greedy Algorithms

• Divide-and-conquer

• Dynamic programming

• Randomized algorithms

Page 18: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 2: Unix-based Operating Systems

• Work should be done on our Linux machines (babbage.cis.uncw.edu).

• Java programming will be bare bones – just a simple text editor and command line compiling (javac)

• Why are we doing this to you?

Page 19: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 2: Unix

• Unix dominates certain markets within computer science. Which ones?

• Unix is better than Microsoft operating systems

• Why didn’t unix become the dominant OS?

• The linux revolution

Page 20: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 2: Unix

• What do you need to learn?– A very small subset of the operating system

language (link)

– A text editor: I’ll show you “vi” (actually it’s “vim”) (http://people.uncw.edu/guinnc/courses/Spring14/332/vi.html)

Page 21: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 3: Becoming a Computer Scientist

• Love what you are doing

• Take delight in problem-solving

• What do computer scientists do?– They take problems and figure out how to use

the computer as a tool to help solve the problem

Page 22: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 3: Becoming a Computer Scientist

So, to be a computer scientist, you need to

1. Be good at problem analysis

2. Know a diversity of techniques that are applicable to computer problem solving

3. Be able to find the match between a problem and possible techniques

Page 23: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 3: Becoming a Computer Scientist

• Douglas R. Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

– Pulitzer prize winning book. – Intended for a general science audience. – Cult classic. Huge online presence.– Tremendous relevance to data structures

(and CSC 360, 532, 415, 515)

Page 24: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Goal 3: Becoming a Computer Scientist

• GEB, in particular, focuses on– Problem-solving– Recursion– Computability– Computational logic

– Can the manipulation of data by formal rules ever lead to true intelligence?

Page 25: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

Unix

• Unix

• Before clicking on that link, look at next page first

Page 26: CSC – 332 Data Structures Dr. Curry Guinn. Quick Info Dr. Curry Guinn –CIS 2045 –guinnc@uncw.eduguinnc@uncw.edu – –962-7937

For Next Class, Thursday

• Blackboard Quiz due Thursday night• Homework 1 due Tuesday, 01/21, 11:59pm• For Tuesday– Login to your shannon account– Play with and look at the man pages for “ls”, “cd”,

“mkdir”, “rmdir”, “rm”, “less”, “more”– Look at these two local links: unix.html and vi.html – Here’s a useful page: http://kb.iu.edu/data/afsk.html