Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is.

Slides:



Advertisements
Similar presentations
Student Projects in the Course Data Structures
Advertisements

Data Structures Data Structures Topic #13. Today’s Agenda Sorting Algorithms: Recursive –mergesort –quicksort As we learn about each sorting algorithm,
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.
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.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone: Course Web site:
Midterm Exam Two Tuesday, November 25 st In class cumulative.
Rossella Lau Lecture 1, DCO20105, Semester A, DCO Data structures and algorithms  Lecture 1: Introduction What this course is about:  Data.
1 Final (important!) details: Uphead & Downheap Java details see code provided for practical 9.
Data Structures, Spring 2004 © L. Joskowicz 1 DAST – Final Lecture Summary and overview What we have learned. Why it is important. What next.
The Design and Analysis of Algorithms
Rossella Lau Lecture 1, DCO20105, Semester A, DCO Data structures and algorithms  Lecture 1: Introduction What this course is about:  Data.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
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.
MA/CSSE 473 Day 22 Binary Heaps Heapsort Answers to student questions Exam 2 Tuesday, Nov 4 in class.
Data Structures Lecture 1: Introduction Azhar Maqsood NUST Institute of Information Technology (NIIT)
Suzanne Westbrook, PhD School of Information: Science, Technology, & Arts Computer Science Dept, UA.
§4 AVL Trees Target : Speed up searching (with insertion and deletion) Tool : Binary search trees root smalllarge Problem : Although T p = O( height ),
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
Java Collections An Introduction to Abstract Data Types, Data Structures, and Algorithms David A Watt and Deryck F Brown © 2001, D.A. Watt and D.F. Brown.
Algorithms and Data Structures TEACH THAT Lassie, what’s in this ADS2 course ? Will it be interesting? woof!
Week 6 - Friday.  What did we talk about last time?  Recursive running time  Fast exponentiation  Merge sort  Introduced the Master theorem.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Data Structures and Algorithms – using JAVA Boro Jakimovski University of Sts Cyril and Methodius, Skopje.
© Jalal Kawash 2010 Graphs Peeking into Computer Science.
© Jalal Kawash 2010 Graphs Peeking into Computer Science.
December 4, Algorithms and Data Structures Lecture XV Simonas Šaltenis Aalborg University
Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1.
Data Structures for Programmers Vamshi Ambati
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Data Structures Lecture 1: Introduction. Course Contents Data Types   Overview, Introductory concepts   Data Types, meaning and implementation  
Week 8 - Wednesday.  What did we talk about last time?  Level order traversal  BST delete  2-3 trees.
1 Data Structures CSCI 132, Spring 2014 Lecture 1 Big Ideas in Data Structures Course website:
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
Data Structures and Algorithms in Java AlaaEddin 2012.
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Graphs. Graph Definitions A graph G is denoted by G = (V, E) where  V is the set of vertices or nodes of the graph  E is the set of edges or arcs connecting.
Exam 2 Review CS 3358 Data Structures. 90 Total Points – 50 Points Writing Programs – 25 Points Tracing Algorithms, determining results, and drawing pictures.
CSC 143T 1 CSC 143 Highlights of Tables and Hashing [Chapter 11 p (Tables)] [Chapter 12 p (Hashing)]
Introduction to Algorithm Complexity Bit Sum Problem.
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.
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.
CSCE 210 Data Structures and Algorithms
Midterm Review.
ADS2 Schedule 2017.
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone:
Exam Hints.
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.
ECET 370 Teaching Effectively-- snaptutorial.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.
Exam 2 Review CS 3358 Data Structures.
Algorithms Chapter 3 With Question/Answer Animations
Data Structures: Introductory lecture
Data structures and algorithms
Algorithms and Data Structures
A Series of Slides in 5 Parts Movement 2. BFS
CSE 326: Data Structures Lecture #14
Week 6 - Monday CS221.
Presentation transcript:

Algorithms and Data Structures TEACH THAT

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

14 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 Lectures … Aye, right.

Algorithms & Data Structures Algorithms & Data Structures Great!

Now and then I will take an attendance register

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

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 Continued 5 pieces of practical work 2 of above are assessed (20%) exam in May (80%) lab every 2 nd week woof

Algorithms & Data Structures Algorithms & Data Structures Great!

our ADS2 website under construction (permanently)

Home

News

The lectures

code & api

Lots of code in there

demos

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. Will you help us with our programming?

Will we use BIG data sets?

woof!

1 st lecture … “Who cares?”

algorithms are ancient Many algorithms predate computers

But first … what is an algorithm?

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

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

Euclid of Alexandria 325BC to 265BC GCD

Data Structures … what’s that then?

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

abstract data types?

Definitions contd. Basically an ADT is an “abstract” entity But a data structure has a fixed implementation (as well as “structural” properties). 60ADS2 Lecture 2

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

An Example: from problem to program Sequencing traffic lights A Formal Model

A-left A-right

A-left A-right B-right B-left B-straight

A-left A-right B-right B-left B-straight C-straight

ALAL ARAR BRBR BSBS BL CSCS

ALAL ARAR BRBR BSBS CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Draw a line (edge) between turns that CANNOT occur at the same time Draw a line (edge) between turns that CANNOT occur at the same time

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed)

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour” Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed)

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Label turns that have an edge between them (adjacent) differently. The minimum number of labels used Is the minimum (maximum) number of concurrent turns disallowed (allowed) For “label” let’s use “colour”

ALAL ARAR BRBR BSBS BL CSCS Therefore we could allow same coloured turns to go at the same time: blue, green, pink and it will be collision-free

ALAL ARAR BRBR BSBS BL CSCS We have 3 time steps

ALAL ARAR BRBR BSBS BL CSCS Could we do it in less than 3 time steps? Is this solution unique? What is the “underlying” problem? What is its complexity? Are there any algorithms that can be used?

ALAL ARAR BRBR BSBS BL CSCS Is Dobie’s Loan actually scheduled optimally?

ALAL ARAR BRBR BSBS BL CSCS Might this be an obvious solution?

B C A E D Try This One way JoJo’s intersection, Princeton

B C A E D AB AC AD BA BC BD DA DB DC EA EB EC ED turns

B C A E D JoJo’s intersection, Princeton

B C A E D JoJo’s intersection, Princeton, USA (allowed a right turn against the lights)

B C A E D JoJo’s intersection, Princeton ED EA BC EC EB DC DA BA AD AC DB AB BD

B C A E D JoJo’s intersection, Princeton ED EA BC EC EB DC DA BA AD AC DB AB BD JoJo’s intersection, Princeton, USA (allowed a right turn against the lights)

B C A E D JoJo’s intersection, Princeton ED EA BC EC EB DC DA BA AD AC DB AB BD

B C A E D JoJo’s intersection, Princeton ED EA BC EC EB DC DA BA AD AC DB AB BD 4 colours 4 steps

B C A E D JoJo’s intersection, Princeton ED EA BC EC EB DC DA BA AD AC DB AB BD 4 colours 4 steps 4-clique!