22
1 CS 130 A: Data Structures and CS 130 A: Data Structures and Algorithms Algorithms Course webpage: www.cs.ucsb.edu/~suri/cs130a/cs130a Email: suri@cs.ucsb.edu Office Hours: 11-12 Wed

0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: [email protected]@cs.ucsb.edu

Embed Size (px)

Citation preview

Page 1: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

1

CS 130 A: Data Structures and AlgorithmsCS 130 A: Data Structures and Algorithms

Course webpage: www.cs.ucsb.edu/~suri/cs130a/cs130a

Email: [email protected]

Office Hours: 11-12 Wed

Page 2: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

2

CS 130A: PrerequisitesCS 130A: Prerequisites

First upper division course More in-depth coverage of data structures and algorithms

Prerequisites CS 16: stacks, queues, lists, binary search trees, … CS 40: functions, recurrence equations, proofs, … Programming competence assumed C, C++, and UNIX Refresh your coding and debugging skills Use TAs

Page 3: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

3

Text BookText Book

Data Structures & Algorithm Analysis in C++ by Mark Allen Weiss

Supplemental material from Introduction to Algorithms, by Cormen, Leiserson, Rivest, Stein [MIT book]

Lecture material primarily based on my notesLecture notes available on my webpageSee web page for lectures updates, assignments.

Page 4: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

4

CS 130 A: Grade CompositionCS 130 A: Grade Composition

2 Midterm exams (30% total) 2 Programming assignments (30% total) 1 Final exam (40%)

Homework assignments They will not be graded: they are to help you practice

problem solving and prepare for exams Solving homework problems key to understanding. Solutions will be made available, so you can self-assess your

understanding and work with TAs to correct your mistakes.

Attend all lectures! Schedule is tentative. Unexpected changes in midterm/exam dates

Page 5: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

5

Some Advice and CautionSome Advice and Caution

Posted schedule of lectures, assignments, exams is tentative

Reviews unplanned Unexpected events may change dates of midterms No makeup exams, no extensions.

Attend all lectures. Read lecture notes (material) before coming to class.

Page 6: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

6

Teaching AssistantsTeaching Assistants

Teaching Assistants: Bay-Yuan Hsu ([email protected])

Discussion: Wed 6:30-7:200 (GIRV 1119) TA hours: Mon 4-6 (Trailer 936)

Semih Yavuz ([email protected]) Discussion: Tues 6:30-7:20 (GIRV 1116) TA hours: Tues 3:30-5:30 (Trailer 936)

Page 7: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

7

Discussion SectionsDiscussion Sections

No discussion section this week

Discussion Format No new material discussed It is meant as a help session Use them to go over homework assignments Programming pointers

But TA are not there to help you write or debug code

Page 8: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

8

What the course is aboutWhat the course is about

The course is primarily about Data Structures

Algorithms covered in small part (20%)

CS 130B is the main algorithms course

Data structures will be motivated by applications although we won’t discuss them in any detail

Page 9: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

9

What the course is aboutWhat the course is about

This is a Theory course, not programming/systems

Primary focus on concepts, design, analysis, proofs Includes 2 coding assignments, but no programming

taught C++, Unix competence expected

My teaching philosophy for 130A Discovery and insights. Big picture. Best understood in abstract form, with pen-paper Alternative Style: learn by coding. (If coding is your thing,

feel free to program the data structures.) Exams on conceptual understanding, not coding details. Homework exercises model for exam questions.

Page 10: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

10

Course OutlineCourse Outline

Introduction and Algorithm Analysis (Ch. 2) Hash Tables: dictionary data structure (Ch. 5, CLRS) Heaps: priority queue data structures (Ch. 6) Balanced Search Trees: general search structures (Ch.

4.1-4.5) Union-Find data structure (Ch. 8.1–8.5, Notes) Graphs: Representations and basic algorithms

Topological Sort (Ch. 9.1-9.2) Minimum spanning trees (Ch. 9.5) Shortest-path algorithms (Ch. 9.3.2)

B-Trees: External-Memory data structures (CLRS, Ch. 4.7) kD-Trees: Multi-Dimensional data structures (Notes, Ch.

12.6) Misc.: Streaming data, randomization (Notes)

Page 11: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

11

What are your goals?What are your goals?

A step towards the BS degree Just a required CS course Becoming a well-rounded computer scientist Intellectual (theory) aspects of CS Clever ideas Interview questions at elite software companies

Page 12: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

12

My goalsMy goals

Algorithms is my research expertise A lively and enormously active area of research Broad impact on almost every area of CS

My personal mission: transmit some of the knowledge and enthusiasm Win the best teacher award

Weekly Jokes Send me your jokes!

Page 13: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

13

Why Study Algorithms and Data Structures?Why Study Algorithms and Data Structures?

Intellectual Pursuit

Page 14: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

14

Why Study Algorithms and Data Structures?Why Study Algorithms and Data Structures?

To become better computer scientist

Page 15: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

15

Why Study Algorithms and Data Structures?Why Study Algorithms and Data Structures?

World domination

Page 16: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

Algorithms are EverywhereAlgorithms are Everywhere

Search Engines GPS navigation Self-Driving Cars E-commerce Banking Medical diagnosis Robotics Algorithmic trading and so on …

16

Page 17: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

Emergence of Computational ThinkingEmergence of Computational Thinking

Computational XPhysics: simulate big bang, analyze LHC data, quantum computing

Biology: model life, brain, design drugs

Chemistry: simulate complex chemical reactions

Mathematics: non-linear systems, dynamics

Engineering: nano materials, communication systems, robotics

Economics: macro-economics, banking networks, auctions

Aeronautics: new designs, structural integrity

Social Sciences, Political Science, Law ….

Page 18: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

Emergence of Computational ThinkingEmergence of Computational Thinking

Page 19: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

19

Modern World of ComputingModern World of Computing

Age of Big Data, birth of Data Science Digitization, communication, sensing, imaging… Entertainment, science, maps, health, environmental,

banking…

Volume, variety, velocity, variability What all happens in 1 Internet minute?

Page 20: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

20

Page 21: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

Intelligent Computational SystemsIntelligent Computational Systems

21

Page 22: 0 CS 130 A: Data Structures and Algorithms n Course webpage: suri/cs130a/cs130asuri/cs130a/cs130a n Email: suri@cs.ucsb.edusuri@cs.ucsb.edu

22

Why Data Structures? Why Data Structures?

Data is just the raw material for information, analytics, business intelligence, advertising, etc

Computational efficient ways of analyzing, storing, searching, modeling data

For the purpose of this course, need for efficient data structures comes down to:

Linear search does not scale for querying large databases

N2 processing or N2 storage infeasible Smart data structures offer an intelligent tradeoff: Perform near-linear preprocessing so that queries can

be answered in much better than linear time