Resolved issue #174 by subdividing list idioms and replacing dict w/ set#576
Merged
Conversation
Contributor
There was a problem hiding this comment.
The under section heading should be the same number of characters as the heading it underlines, e.g.,
Create a string from a list
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some text
Searching for an item in a collection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Other textNote, I used ^ because GitHub wouldn't render those properly with ~.
Contributor
|
A couple notes, otherwise 👍 |
Contributor
Author
|
Good catch. Fixed! |
Contributor
|
Thanks @emilydolson! ✨ 🍰 ✨ |
sigmavirus24
added a commit
that referenced
this pull request
Oct 3, 2015
Resolved issue #174 by subdividing list idioms and replacing dict w/ set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #174, it's probably preferable to suggest using a set in place of a dictionary with empty values when talking about the benefits of hashtables for search speed, in "Create a length-N list of lists" in the idioms section. It seems like part of the reason dictionaries were originally used there is that this section actually bundles a few related idioms together. For clarity (and to be able to talk about search speed without being forced to use the motivating example of a collection of lists), I split this section into three:
In the "Searching for an item in a collection" section, I replaced the dictionary with a set, and added a brief explanation on the trade-offs between lists and sets/dictionaries, and when you might want to use one vs the other.
I think this should address all of the points raised in issue #174.