Algorithms and Data Structures

Slides:



Advertisements
Similar presentations
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Advertisements

CSCE 210 Data Structures and Algorithms
1 Assignment 2: (Due at 10:30 a.m on Friday of Week 10) Question 1 (Given in Tutorial 5) Question 2 (Given in Tutorial 7) If you do Question 1 only, you.
Abstract Data Types (ADT)
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 10.
HORSEED International University
DATA STRUCTURE Subject Code -14B11CI211.
Data Structures Lecture-1:Introduction
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Algorithms and Data Structures TEACH THAT Lassie, what’s in this ADS2 course ? Will it be interesting? woof!
Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Data Structures for Programmers Vamshi Ambati
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
1 Data Structures CSCI 132, Spring 2014 Lecture 1 Big Ideas in Data Structures Course website:
CS321 Data Structures Jan Lecture 2 Introduction.
Data Structures and Algorithms in Java AlaaEddin 2012.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
COMP 103 Course Review. 2 Menu  A final word on hash collisions in Open Addressing / Probing  Course Summary  What we have covered  What you should.
Chapter 3 Lists, Stacks, Queues. Abstract Data Types A set of items – Just items, not data types, nothing related to programming code A set of operations.
1 i206: Lecture 17: Exam 2 Prep ; Intro to Regular Expressions Marti Hearst Spring 2012.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Algorithm homework help For More Detail help.aspx - Phone:-
Introduction toData structures and Algorithms
Final Exam Review CS 3358.
CSCE 210 Data Structures and Algorithms
CSE373: Data Structures & Algorithms Priority Queues
Course Developer/Writer: A. J. Ikuomola
Week 7 - Friday CS221.
The Design and Analysis of Algorithms
Midterm Review.
ADS2 Schedule 2017.
CSCI 210 Data Structures and Algorithms
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone:
CS Data Structures Chapter 8 Lists Mehmet H Gunes
March 29 – Testing and Priority QUeues
DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++
Exam Hints.
Hashing Exercises.
Computer Science 102 Data Structures CSCI-UA
Teach A level Computing: Algorithms and Data Structures
ECET 370 HELPS Education Your Life-- ecet370helps.com.
ECET 370 Lessons in Excellence-- ecet370.com. ECET 370 Entire Course (Devry) For more course tutorials visit ECET 370 Week 1 Lab 1 ECET.
ECET 370 HELPS Lessons in Excellence- -ecet370helps.com.
ECET370 Education for Service-- ecet370.com. ECET 370 Entire Course (Devry) For more course tutorials visit ECET 370 Week 1 Lab 1 ECET.
ECET 370 HELPS Education for Service- - ecet370helps.com.
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
structures and their relationships." - Linus Torvalds
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
structures and their relationships." - Linus Torvalds
Exam 2 Review CS 3358 Data Structures.
Final Exam Review COP4530.
B-Tree Insertions, Intro to Heaps
Data Structures: Introductory lecture
Hassan Khosravi / Geoffrey Tien
Week # 1: Overview & Review
Data structures and algorithms
Introduction to Data Structures
EE 312 Final Exam Review.
COP3530- Data Structures Introduction
slides created by Ethan Apter
Data Structures and Algorithms
CSE 326: Data Structures Lecture #14
structures and their relationships." - Linus Torvalds
Week 6 - Monday CS221.
Presentation transcript:

Algorithms and Data Structures

Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is a bit like a “machine” or a specialised tool

Algorithms and Data Structures A data structure is some way to represent and store data so that we can process that data efficiently

Algorithms and Data Structures Data structures use algorithms Algorithms use data structures

Algorithms and Data Structures Data Structures and Algorithms a Computer Scientist’s building blocks

Algorithms and Data Structures Computer Scientist invent and study algorithms and data structures and problems

Algorithms and Data Structures Computer Scientists do other things too 

Our website, link from moodle

Lecture

Why don’t I just go away and read the book myself? Lectures … Aye, right. Why don’t I just go away and read the book myself? Why come to lectures? meet new exciting people keep in touch with fashion, trends, … be part of the “in” crowd ADS2 Lecture 1 12

Great! Algorithms & Data Structures Algorithms & Data Structures

Lassie, what’s in this ADS2 course ? Will it be interesting? woof!

Content linked lists single/doubly-linked, insert, delete, find, min, max, … stacks push/pop/size bracket matching, RP calculator queues enqueue/dequeue/size circular queue (in array) recursion see above big O 

Continued Content trees n-ary trees: representations & properties binary trees representations & properties & traversals binary search trees insert/find/delete/traverse/height … AVL trees heap insert/delete/sort splay trees (maybe) red-black trees (maybe)

Continued Content skip lists (maybe) Sorting bubble/insert/sift sort merge sort quick sort bucket sort (pigeon hole sort) bead sort (maybe) Dictionaries maps and hash tables open and closed hashing

Continued Content 5 pieces of practical work 2 of above are assessed (20%) exam in May (80%) lab every week woof

Great! Algorithms & Data Structures Algorithms & Data Structures

our ADS2 website under construction (permanently)

Home

News

The lectures

The lectures

code & api

Lots of code in there

demos

Links to interesting & useful stuff

Links to interesting & useful stuff

exercises

Questions & Answers

… and now for something completely different!!!

Lassie, why are algorithms and data structures important?

Lassie, will there be anything in the course that is challenging and exciting?

I just hope I get feedback, continuously

Lassie, will you teach us to “THINK LIKE A COMPUTER SCIENTIST”?

Lassie, honestly, I’m not that experienced as a programmer Lassie, honestly, I’m not that experienced as a programmer. Will you help us with our programming?

Will we use BIG data sets?

woof!

1st lecture … “Who cares?”

algorithms are ancient Many algorithms predate computers

But first … what is an algorithm?

A finite sequence of instructions, each with a What is an algorithm? A finite sequence of instructions, each with a clear meaning, and can be performed with a finite amount of effort in a finite length of time [Aho, Hopcroft, Ullman 1983]

Before some of you were born

Prim’s Algorithm ADS2 Lecture 1

Abu Jafar Mohammed ibm Musa Al Khwarizmi Before I was born 800AD

325BC to 265BC GCD Euclid of Alexandria

Euclid’s algorithm ADS2 Lecture 1

Euclid’s algorithm ADS2 Lecture 1

Code is not an algorithm … maybe a realisation of an algorithm Euclid’s algorithm Code is not an algorithm … maybe a realisation of an algorithm ADS2 Lecture 1

Algorithms you might know/use Addition/subtraction Long division/multiplication Tying your shoe laces Changing a tyre on your bike Baking a cake Opening a bottle of beer … ADS2 Lecture 1

Algorithms you might know/use Addition/subtraction Long division/multiplication Tying your shoe laces Changing a tyre on your bike Baking a cake Opening a bottle of beer A finite sequence of instructions, each with a clear meaning, and can be performed with a finite amount of effort in a finite length of time [Aho, Hopcroft, Ullman 1983] ADS2 Lecture 1

Addition/subtraction Long division/multiplication Tying your shoe laces Changing a tyre on your bike Baking a cake Opening a bottle of beer Algorithms you might know/use A finite sequence of instructions, each with a clear meaning, and can be performed with a finite amount of effort in a finite length of time [Aho, Hopcroft, Ullman 1983] It terminates It produces correct result It has a “complexity” (measure of performance) All steps can be performed without “magic” ADS2 Lecture 1

Things I do not consider to be algorithms Algorithmic trading Rules to decide if you get a loan or a job or … ADS2 Lecture 1

Things I do not consider to be algorithms http://www.bbc.co.uk/programmes/b085wj18#play ADS2 Lecture 1

Data Structures … what’s that then? ADS2 Lecture 1

Data Structures … what’s that then?

ways to organise data/information efficiently Not a Data structure – ADT (see next slide) Data structure Data structure Data structure ways to organise data/information efficiently where will I (not) see data structures?

abstract data types?

Definitions contd. Basically an ADT is an “abstract” entity Set, Queue, Priority Queue, Stack, … But a data structure has a fixed implementation (as well as “structural” properties). ADS2 Lecture 2 65

Who cares? Machines are getting bigger, faster, cheaper … do efficient data structures and algorithms really matter?

Bigger, faster, cheaper machines Bigger data sets, greater expectations

You have a file of names of people We don’t know how many people What data structures might we use and what algorithms? An example … You have a file of names of people We don’t know how many people Read them in to memory and allow Find Add delete ADS2 Lecture 1

What data structures might we use and what algorithms? A quick look at fBook We have a file of people members.txt and a file of friends with entries that are pairs of names of people who are friends. We want to be able to find people, find out who is friends with whom … basically, a toy facebook ADS2 Lecture 1

Refreshed our knowledge of ArrayList Consequences of add and remove What have we learned? What data structures might we use and what algorithms? Refreshed our knowledge of ArrayList Consequences of add and remove How to compile and run on the command line What args means ADS2 Lecture 1

ADS2 Lecture 1

ADS2 Lecture 1

Person ADS2 Lecture 1

Person ADS2 Lecture 1

Person ADS2 Lecture 1

I dream of ArrayLists

So, ArrayList created with space for 10 objects! That’s enormous 

And when I add an object into a given position it shuffle things up And when I add an object into a given position it shuffle things up. Is that for free? Does that take any time?

And what happens when I want to put in an 11th object into my ArrayList?

Back to Person ADS2 Lecture 1

Person constructor ADS2 Lecture 1

Person utilities ADS2 Lecture 1

Person For printing ADS2 Lecture 1

FBook ADS2 Lecture 1

FBook ADS2 Lecture 1

FBook ADS2 Lecture 1

FBook Given a name as a String create a person with that name and make them a member of FBook ADS2 Lecture 1

FBook Opening a file, reading it, creating persons and adding them as members ADS2 Lecture 1

Find a person with a given name … 1st algorithm FBook ADS2 Lecture 1

Find a person with a given name … 1st algorithm FBook But how did we need to structure the data so that we can use that algorithm ADS2 Lecture 1

Find a person with a given name … 1st algorithm FBook But how did we need to structure the data so that we can use that algorithm How efficient is that algorithm, and what could we have used instead? ADS2 Lecture 1

FBook ADS2 Lecture 1

Test ADS2 Lecture 1

ADS2 Lecture 1

Test What are args[]? ADS2 Lecture 1

Test HCI Fail? ADS2 Lecture 1

I want to keep it simple ADS2 Lecture 1

So, let’s compile and run it … ADS2 Lecture 1

So, what have we learned … The need for dynamic data structures Refreshed our knowledge of ArrayList Consequences of add and remove in ArrayList Algorithms & data structures go hand in hand How to compile and run on the command line What args means Keeping it simple … ADS2 Lecture 1