algorithms and data structures teach that algorithms and data structures an algorithm does...
TRANSCRIPT
![Page 1: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/1.jpg)
![Page 2: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/2.jpg)
Algorithms and Data Structures
TEACH THAT
![Page 3: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/3.jpg)
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
![Page 4: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/4.jpg)
Algorithms and Data Structures
A data structure is some way to represent and store dataso that we can process that data efficiently
![Page 5: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/5.jpg)
Algorithms and Data Structures
Data structures use algorithms
Algorithms use data structures
![Page 6: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/6.jpg)
Algorithms and Data Structures
Data Structures and Algorithmsa Computer Scientist’s building blocks
![Page 7: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/7.jpg)
Algorithms and Data Structures
Computer Scientist invent and study algorithms and data structures and problems
![Page 8: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/8.jpg)
Algorithms and Data Structures
Computer Scientists do other things too
![Page 9: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/9.jpg)
![Page 10: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/10.jpg)
Our website, link from moodle
![Page 11: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/11.jpg)
![Page 12: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/12.jpg)
![Page 13: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/13.jpg)
Lecture
![Page 14: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/14.jpg)
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.
![Page 15: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/15.jpg)
Algorithms&
Data Structures
Algorithms
&
Data Structures
Great!
![Page 16: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/16.jpg)
![Page 17: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/17.jpg)
Now and then I will take an attendance register
![Page 18: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/18.jpg)
Lassie, what’s in this ADS2 course ? Will it be interesting?
woof!
![Page 19: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/19.jpg)
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
![Page 20: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/20.jpg)
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
![Page 21: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/21.jpg)
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
![Page 22: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/22.jpg)
ContentContinued
• 5 pieces of practical work• 2 of above are assessed (20%)• exam in May (80%)• lab every 2nd week• woof
![Page 23: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/23.jpg)
Algorithms&
Data Structures
Algorithms
&
Data Structures
Great!
![Page 24: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/24.jpg)
![Page 25: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/25.jpg)
our ADS2 website under construction
(permanently)
![Page 26: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/26.jpg)
Home
![Page 27: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/27.jpg)
News
![Page 28: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/28.jpg)
The lectures
![Page 29: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/29.jpg)
The lectures
![Page 30: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/30.jpg)
code & api
![Page 31: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/31.jpg)
Lots of code in there
![Page 32: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/32.jpg)
demos
![Page 33: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/33.jpg)
Links to interesting & useful stuff
![Page 34: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/34.jpg)
Links to interesting & useful stuff
![Page 35: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/35.jpg)
exercises
![Page 36: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/36.jpg)
exercises
![Page 37: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/37.jpg)
exercises
![Page 38: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/38.jpg)
Questions & Answers
![Page 39: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/39.jpg)
… and now for something completely different!!!
![Page 40: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/40.jpg)
Lassie, why are algorithms and data structures important?
![Page 41: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/41.jpg)
Lassie, will there be anything in the course that is challenging and exciting?
![Page 42: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/42.jpg)
I just hope I get feedback, continuously
![Page 43: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/43.jpg)
Lassie, will you teach us to “THINK LIKE A COMPUTER SCIENTIST”?
![Page 44: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/44.jpg)
Lassie, honestly, I’m not that experienced as a programmer. Will you help us with our programming?
![Page 45: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/45.jpg)
![Page 46: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/46.jpg)
Will we use BIG data sets?
![Page 47: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/47.jpg)
woof!
![Page 48: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/48.jpg)
1st lecture … “Who cares?”
![Page 49: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/49.jpg)
algorithms are ancient
Many algorithms predate computers
![Page 50: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/50.jpg)
But first … what is an algorithm?
![Page 51: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/51.jpg)
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]
![Page 52: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/52.jpg)
![Page 53: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/53.jpg)
Before some of you were born
![Page 54: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/54.jpg)
Abu Jafar Mohammed ibm Musa Al Khwarizmi
800AD
Before I was born
![Page 55: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/55.jpg)
Euclid of Alexandria
325BC to 265BC
GCD
![Page 56: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/56.jpg)
![Page 57: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/57.jpg)
Data Structures … what’s that then?
![Page 58: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/58.jpg)
ways to organise data/information efficiently
where will I (not) see data structures?
Data structure
Data structure
Data structure
Not a Data structure – ADT (see next slide)
![Page 59: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/59.jpg)
abstract data types?
![Page 60: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/60.jpg)
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
![Page 61: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/61.jpg)
Who cares?Machines are getting
bigger, faster, cheaper … do efficient data structures and
algorithms really matter?
![Page 62: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/62.jpg)
![Page 63: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/63.jpg)
Bigger, faster, cheaper machines
Bigger data sets, greater expectations
![Page 64: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/64.jpg)
An Example: from problem to program
Sequencing traffic lightsA Formal Model
![Page 65: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/65.jpg)
![Page 66: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/66.jpg)
![Page 67: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/67.jpg)
![Page 68: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/68.jpg)
![Page 69: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/69.jpg)
![Page 70: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/70.jpg)
![Page 71: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/71.jpg)
![Page 72: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/72.jpg)
![Page 73: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/73.jpg)
![Page 74: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/74.jpg)
A-left
A-right
![Page 75: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/75.jpg)
A-left
A-right
B-right
B-leftB-straight
![Page 76: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/76.jpg)
A-left
A-right
B-right
B-leftB-straight
C-straight
![Page 77: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/77.jpg)
AL
AR
BR
BS
BL
CS
![Page 78: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/78.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 79: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/79.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 80: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/80.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 81: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/81.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 82: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/82.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 83: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/83.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 84: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/84.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 85: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/85.jpg)
AL
AR
BR
BS
BL
CS
Draw a line (edge) between turns that CANNOT occur atthe same time
Draw a line (edge) between turns that CANNOT occur atthe same time
![Page 86: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/86.jpg)
AL
AR
BR
BS
BL
CS
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)
![Page 87: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/87.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 88: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/88.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 89: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/89.jpg)
AL
AR
BR
BS
BL
CS
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)
![Page 90: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/90.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 91: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/91.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 92: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/92.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 93: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/93.jpg)
AL
AR
BR
BS
BL
CS
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”
![Page 94: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/94.jpg)
AL
AR
BR
BS
BL
CS
Therefore we could allow same colouredturns to go at the same time: blue, green, pink and it will be collision-free
![Page 95: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/95.jpg)
AL
AR
BR
BS
BL
CS
We have 3 time steps
![Page 96: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/96.jpg)
AL
AR
BR
BS
BL
CS
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?
![Page 97: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/97.jpg)
AL
AR
BR
BS
BL
CS
Is Dobie’s Loan actually scheduled optimally?
![Page 98: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/98.jpg)
AL
AR
BR
BS
BL
CS
Might this be an obvious solution?
![Page 99: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/99.jpg)
B
C
A
E
D
Try This
One way
JoJo’s intersection, Princeton
![Page 100: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/100.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ABACADBABCBDDADBDCEAEBECED
turns
![Page 101: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/101.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
![Page 102: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/102.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
JoJo’s intersection, Princeton, USA (allowed a right turn against the lights)
![Page 103: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/103.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
ED
EA
BC
EC
EB
DC
DA
BA
AD
AC
DB
AB
BD
![Page 104: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/104.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
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)
![Page 105: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/105.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
ED
EA
BC
EC
EB
DC
DA
BA
AD
AC
DB
AB
BD
![Page 106: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/106.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
ED
EA
BC
EC
EB
DC
DA
BA
AD
AC
DB
AB
BD
4 colours4 steps
![Page 107: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/107.jpg)
B
C
A
E
D
JoJo’s intersection, Princeton
ED
EC
EB
EA
DC
DB
DA
BD
BC
BA
AD
AC
AB
EDECEBEADCDBDABDBCBAADACAB
1111
11111
111
111
11111
11111
11
111
11111
1111
ED
EA
BC
EC
EB
DC
DA
BA
AD
AC
DB
AB
BD
4 colours4 steps
4-clique!
![Page 108: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/108.jpg)
![Page 109: Algorithms and Data Structures TEACH THAT Algorithms and Data Structures An algorithm does something, solves some problem, in a mechanical way. It is](https://reader036.vdocuments.mx/reader036/viewer/2022062423/56649ef45503460f94c080fb/html5/thumbnails/109.jpg)