Jeff Cohen
August 04, 2017
120

# Computer Science: The Good Parts

Kansas City Developers Conference

August 04, 2017

## Transcript

2. ### 1. Encoding All The Things 2. Containers for Things 3.

Doing Things 4. Building Big Things 5. Thinking About Things

6. ### Queue New elements are appended to the end of the

list 60 31 5 45 70 head
7. ### Stack 60 45 70 31 5 head New elements are

inserted at the front of the list
8. ### 60 31 5 45 80 70 74 99 87 68

Binary  Tree root

16. ### Complexity A "green" test suite is not an indicator of

sustainability nor is it a guarantee of an optimal solution.
17. ### Complexity Science relies on standard systems of weights and measures.

For software, we measure resources, which are typically time and space.
18. ### O(n) def search(name_to_find, names) for name in names if name

== name_to_find return true end end return false end
19. ### def search(name_to_find, names) for name in names if name ==

name_to_find return true end end return false end O(n) 0 100 200 300 O(n)
20. ### O(log n) def search(name_to_find, sorted_names)   return false if sorted_names.size

== 0   midpoint = sorted_names.length / 2     if name < sorted_names[midpoint].name   search(name_to_find, sorted_names[0, midpoint])   elsif name > sorted_names[midpoint].name  search(name_to_find, sorted_names[midpoint, -1]) end return true  end
21. ### def search(name_to_find, sorted_names)   return false if sorted_names.size == 0

midpoint = sorted_names.length / 2     if name < sorted_names[midpoint].name   search(name_to_find, sorted_names[0, midpoint])   elsif name > sorted_names[midpoint].name  search(name_to_find, sorted_names[midpoint, -1]) end return true  end O(log n) 0 100 200 300 O(log n) O(n)

23. ### O(n2) def all_permuations(items) items.map do |item| items.map { |inner_item| [item,

inner_item] } end end [1,2,3] => [[1,1], [1,2], [1,3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]
24. ### def all_permuations(items) items.map do |item| items.map { |inner_item| [item, inner_item]

} end end O(n2) 0 100 200 300 O(n2) O(n) O(log n)

30. ### Traditions We know our history. We value progress over reinvention.

We seek solutions to meaningful problems.

36. ### Grace Hopper Humans are allergic to change. They love to

say, "We've always done it this way." I try to ﬁght that.    That's why I have a clock on my wall that runs counter-clockwise.
37. ### Grace Hopper A ship in port is safe; but that

is not what ships are built for. Sail out to sea and do new things.
38. ### Questions? Thoughts? Find me on twitter @jeffcohen Notes, Links, Resources:

csthegoodparts.com