Top Banner
CSC 211 - Data Structures and Algorithms – An Introduction
14

CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Feb 27, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

CSC 211 - Data Structures andAlgorithms – An Introduction

Page 2: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

What this course is about ?

• Data structures: conceptual and concrete ways toorganize data for efficient storage and efficientmanipulation

• Employment of this data structures in the design ofefficient algorithms

• Data structures: conceptual and concrete ways toorganize data for efficient storage and efficientmanipulation

• Employment of this data structures in the design ofefficient algorithms

Page 3: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Why do we need them ?

• Computers take on more and more complex tasks– Imagine: index of 30 trillion pages in the Google Index!

(Google)- 100,000,000 gigabytes. Google says that it storesThat’s about a thousand terabytes, and you’d need overthree million 32GB USB thumb drives to store all that data.

When you search:• Google tries to figure out what you’re typing into

the box, what you mean.

• Computers take on more and more complex tasks– Imagine: index of 30 trillion pages in the Google Index!

(Google)- 100,000,000 gigabytes. Google says that it storesThat’s about a thousand terabytes, and you’d need overthree million 32GB USB thumb drives to store all that data.

When you search:• Google tries to figure out what you’re typing into

the box, what you mean.

Page 4: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Why do we need them ?

• So algorithms for spelling, autocompletion,synonyms, and query understanding jump into action.

• When Google thinks it knows what you want, it pullsresults from those 30 trillion pages and 100 milliongigabytes, but it doesn’t just give you what it finds.

• So algorithms for spelling, autocompletion,synonyms, and query understanding jump into action.

• When Google thinks it knows what you want, it pullsresults from those 30 trillion pages and 100 milliongigabytes, but it doesn’t just give you what it finds.

Page 5: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Why do we need them ?

• Ranking procedure uses over 200 closely guardedsecret factors that look at the freshness of the results,quality of the website, age of the domain, safety andappropriateness of the content, and user context likelocation, prior searches, Google+ history andconnections, and much more.

• Then, in just over an eighth of a second, Google thendelivers the results to your computer, tablet, or phone.

• Ranking procedure uses over 200 closely guardedsecret factors that look at the freshness of the results,quality of the website, age of the domain, safety andappropriateness of the content, and user context likelocation, prior searches, Google+ history andconnections, and much more.

• Then, in just over an eighth of a second, Google thendelivers the results to your computer, tablet, or phone.

Page 6: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Why do we need them ?

• Software implementation and maintenance isdifficult.

• Clean conceptual framework allows for more efficientand more correct code

• Software implementation and maintenance isdifficult.

• Clean conceptual framework allows for more efficientand more correct code

Page 7: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Why do we need them• Requirements for a good software:

– Clean Design– Easy maintenance– Reliable (no core dumps)– Easy to use– Fast algorithms

Efficient data structuresEfficient algorithms

• Requirements for a good software:– Clean Design– Easy maintenance– Reliable (no core dumps)– Easy to use– Fast algorithms

Efficient data structuresEfficient algorithms

Page 8: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Example

• A collection of 3,000 texts with avg. of 20 lines each,with avg. 10 words / line– 600,000 words

• Find all occurrences of the word “happy”• Suppose it takes 1 sec. to check a word for correct

matching• What do you do?

• A collection of 3,000 texts with avg. of 20 lines each,with avg. 10 words / line– 600,000 words

• Find all occurrences of the word “happy”• Suppose it takes 1 sec. to check a word for correct

matching• What do you do?

Page 9: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Example (cont’d)

• What to do?Sol. 1 Sequential matching: 1 sec. x 600,000 words = 166 hoursSol. 2 Binary searching:

- order the words- search only half at a time

Ex. Search 25 in 5 8 12 15 15 17 23 25 2725 ? 15 15 17 23 25 2725 ? 23 23 25 2725 ? 25

How many steps?

• log 2 600000 = 19 sec. vs .166 hours!

• What to do?Sol. 1 Sequential matching: 1 sec. x 600,000 words = 166 hoursSol. 2 Binary searching:

- order the words- search only half at a time

Ex. Search 25 in 5 8 12 15 15 17 23 25 2725 ? 15 15 17 23 25 2725 ? 23 23 25 2725 ? 25

How many steps?

• log 2 600000 = 19 sec. vs .166 hours!

Page 10: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Some example data structures

SetStack

Tree

Data structure = representation and operationsassociated with a data type

Page 11: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

What will you learn?

• What are some of the common data structures

• What are some ways to implement them

• How to analyze algorithm efficiency

• How to use them to solve practical problems

• What are some of the common data structures

• What are some ways to implement them

• How to analyze algorithm efficiency

• How to use them to solve practical problems

Page 12: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

What you need

Programming experience with C / C++Textbooks• Data Structures and Algorithms from the SCI Library• Michael T. Goodrich, Roberto Tamassia, David M. Mount (2011). Data

Structures and Algorithms in C++. Second Edition 2011 , John Wiley &Sons, Inc.

Programming experience with C / C++Textbooks• Data Structures and Algorithms from the SCI Library• Michael T. Goodrich, Roberto Tamassia, David M. Mount (2011). Data

Structures and Algorithms in C++. Second Edition 2011 , John Wiley &Sons, Inc.

Page 13: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Course Content

Introduction to Data structuresProblem solving stepsArraysListsStacks and QueuesTreesBinary Search TreesSearch TreesGraphs and graph algorithmsHeaps / Priority QueuesSorting algorithms

Introduction to Data structuresProblem solving stepsArraysListsStacks and QueuesTreesBinary Search TreesSearch TreesGraphs and graph algorithmsHeaps / Priority QueuesSorting algorithms

Page 14: CSC 211 - Data Structures and Algorithms – An Introduction · 2019-12-09 · CSC 211 - Data Structures and Algorithms – An Introduction. What this course is about ? • Data structures:

Remember…

Regular class attendance and active participation inclass Undertaking Assignments, Practical's and CATS Taking the final Exams Assessment

Assignments, Practical's, CATs – 50%Final Exam – 50%Pass Mark – 40%

Regular class attendance and active participation inclass Undertaking Assignments, Practical's and CATS Taking the final Exams Assessment

Assignments, Practical's, CATs – 50%Final Exam – 50%Pass Mark – 40%