Complexity 7-1 Complexity Andrei Bulatov Complexity of Problems.
The Complexity of Songs
-
Upload
guestacae495 -
Category
Education
-
view
489 -
download
5
description
Transcript of The Complexity of Songs
![Page 1: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/1.jpg)
The Complexityof Songs
By Rohan Sharma
![Page 2: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/2.jpg)
Disclaimer
![Page 3: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/3.jpg)
“The Ideal Talk”
![Page 4: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/4.jpg)
Introduction
![Page 5: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/5.jpg)
Informative
![Page 6: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/6.jpg)
Accessible
![Page 7: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/7.jpg)
< 10 minutes
![Page 8: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/8.jpg)
My Talk
![Page 9: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/9.jpg)
No introduction
![Page 10: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/10.jpg)
Uninformative
![Page 11: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/11.jpg)
Arcane
![Page 12: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/12.jpg)
Possibly> 10 minutes
![Page 13: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/13.jpg)
Possibly> 10 minutes
![Page 14: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/14.jpg)
</Disclaimer>
![Page 15: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/15.jpg)
ComputerScience
![Page 16: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/16.jpg)
ComputerScience
![Page 17: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/17.jpg)
ComputerScience
![Page 18: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/18.jpg)
![Page 19: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/19.jpg)
ComputerScience
![Page 20: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/20.jpg)
![Page 21: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/21.jpg)
Astronomy
![Page 22: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/22.jpg)
![Page 23: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/23.jpg)
Warning:Boring Stuff Ahead!
![Page 24: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/24.jpg)
(Removed picture of friend sleeping.)
![Page 25: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/25.jpg)
Computational Complexity
![Page 26: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/26.jpg)
Largest Member
![Page 27: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/27.jpg)
3 2 7 9 1
![Page 28: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/28.jpg)
3 2 7 9 1
![Page 29: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/29.jpg)
3 2 7 9 1
![Page 30: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/30.jpg)
3 2 7 9 1
![Page 31: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/31.jpg)
3 2 7 9 1
![Page 32: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/32.jpg)
3 2 7 9 1
![Page 33: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/33.jpg)
3 2 7 9 1
![Page 34: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/34.jpg)
3 2 7 9 1
![Page 35: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/35.jpg)
Linear TimeO(n)
![Page 36: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/36.jpg)
Binary Search
![Page 37: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/37.jpg)
3 7 10 21 33 39 46
Search for 10
![Page 38: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/38.jpg)
3 7 10
Search for 10
![Page 39: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/39.jpg)
10
Found 10
![Page 40: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/40.jpg)
Logarithmic timeO(lg n)
![Page 41: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/41.jpg)
(Removed picture of friend opening his mouth wide open like the Grand
Canyon.)
![Page 42: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/42.jpg)
![Page 43: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/43.jpg)
![Page 44: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/44.jpg)
![Page 45: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/45.jpg)
The Complexity of Songs
![Page 46: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/46.jpg)
![Page 47: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/47.jpg)
How?
![Page 48: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/48.jpg)
Letters?
![Page 49: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/49.jpg)
Tedious!
![Page 50: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/50.jpg)
Words?
![Page 51: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/51.jpg)
Yes!
![Page 52: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/52.jpg)
Toughest: O(n) Easiest: O(1)
![Page 53: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/53.jpg)
![Page 54: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/54.jpg)
Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you
![Page 55: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/55.jpg)
Never gonna give you upNever gonna let you downNever gonna run around and desert youNever gonna make you cryNever gonna say goodbyeNever gonna tell a lie and hurt you
FAIL
![Page 56: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/56.jpg)
Breakthrough
![Page 57: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/57.jpg)
![Page 58: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/58.jpg)
O(n1/2)
![Page 59: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/59.jpg)
The Twelve Days of Christmas
On the first day of Christmas my true love sent to me A partridge in a pear tree.
On the second day of Christmas my true love sent to me Two turtle doves, and a partridge in a pear tree.
On the third day of Christmas, my true love sent to me Three French hens, two turtle doves, and a partridge in a pear tree.
![Page 60: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/60.jpg)
The Twelve Days of Christmas
On the first day of Christmas my true love sent to me gift 1
On the second day of Christmas my true love sent to me gift 1, gift 2
On the third day of Christmas, my true love sent to me gift 1, gift 2, gift 3
...
On the nth day of Christmas, my true love sent to me gift 1, gift 2, gift 3, ..., gift n
![Page 61: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/61.jpg)
The Twelve Days of Christmas
gift 1gift 1, gift 2gift 1, gift 2, gift 3...gift 1, gift 2, gift 3, ..., gift n
![Page 62: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/62.jpg)
The Twelve Days of Christmas
gift 1gift 1, gift 2gift 1, gift 2, gift 3...gift 1, gift 2, gift 3, ..., gift n
![Page 63: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/63.jpg)
O(n1/2)
![Page 64: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/64.jpg)
Breakthrough #2
![Page 65: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/65.jpg)
N Bottles of Beer
n bottles of beer on the walln bottles of beer!You take one down, and pass it aroundn - 1 bottles of beer on the wall!
![Page 66: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/66.jpg)
O(lg n)
![Page 67: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/67.jpg)
![Page 68: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/68.jpg)
O(1)
![Page 69: The Complexity of Songs](https://reader035.fdocuments.us/reader035/viewer/2022062511/54bf83104a79599e298b459d/html5/thumbnails/69.jpg)
Questions?