Skip to content

Commit

Permalink
Change up some slides; cut out persistent amortized analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
zkayser committed May 18, 2019
1 parent 7427106 commit f978d5d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added assets/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,7 @@ code {
.hljs-emphasis {
font-style: italic;
}

.hljs-comment {
color: yellow;
}
Binary file added assets/static/.DS_Store
Binary file not shown.
Binary file added assets/static/images/border.svg-line3769-377.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/pfds_visualizations_web/navigation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ defmodule PfdsVisualizationsWeb.Navigation do
},
"/slides/39" => %{
prev: Helpers.slide_path(Endpoint, :show, "38"),
next: Helpers.slide_path(Endpoint, :show, "40")
next: Helpers.slide_path(Endpoint, :show, "48")
},
"/slides/40" => %{
prev: Helpers.slide_path(Endpoint, :show, "39"),
Expand Down Expand Up @@ -202,7 +202,7 @@ defmodule PfdsVisualizationsWeb.Navigation do
next: Helpers.slide_path(Endpoint, :show, "48")
},
"/slides/48" => %{
prev: Helpers.bankers_queue_path(Endpoint, :index)
prev: Helpers.slide_path(Endpoint, :show, "39")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
def head(queue)
def tail(queue)
def snoc(queue, new_element)
# Yep, `snoc` is a weird name that doesn't really mean anything
# But, it is the word `cons` backward.
# Some may recognize this as being roughly equivalent to
# Elixir's | in [head|tail] (appending a thing on to the head of a list).
# With `snoc`, we are appending a thing to the rear of a queue.
# Yep, `snoc` is a weird name :)
# It could be called `add` because it
# adds an element to the queue
</code>
</pre>
2 changes: 1 addition & 1 deletion lib/pfds_visualizations_web/views/bankers_queue_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule PfdsVisualizationsWeb.BankersQueueView do
defp to_list(stream) do
case Suspension.force(stream) do
:empty -> []
%{head: head, tail: tail} -> to_list_(tail, [head])
%{head: head, tail: tail} -> to_list_(tail, [head]) |> :lists.reverse()
end
end

Expand Down

0 comments on commit f978d5d

Please sign in to comment.