FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-33872: Add list elements access complexity by andresdelfino · Pull Request #7728 · python/cpython · GitHub

Repository navigation

bpo-33872: Add list elements access complexity - #7728

Closed
andresdelfino wants to merge 5 commits into
python:masterfrom
andresdelfino:patch-2
Closed

andresdelfino wants to merge 5 commits into
python:masterfrom
andresdelfino:patch-2

Conversation

andresdelfino commented Jun 15, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Comment thread Doc/library/stdtypes.rst Outdated
Lists are mutable sequences, typically used to store collections of
homogeneous items (where the precise degree of similarity will vary by
application).
application). List elements are accessed with a O(1).

pablogsal Jun 15, 2018 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Suggestion: "List elements are accessed with O(1) time complexity" or "Accessing list elements has O(1) time complexity".

"List elements are accessed with a O(1)" sounds a bit off to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMHO, mentioning "time complexity" is definitely an improvement, I'll rephrase, thanks :)

We are not talking much about time complexity in other parts of the documentation. Change it to mimic the intention in the Glossary: avoid the confusion with linked lists.
Comment thread Doc/library/stdtypes.rst Outdated
application).

Despite its name, lists are more akin to arrays in other languages than to
linked lists, since its elements are accessed with time complexity O(1).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Use plural: “their name”, “their elements”, to agree with “lists are”

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

😅 thanks!

Comment thread Doc/library/stdtypes.rst
homogeneous items (where the precise degree of similarity will vary by
application).

Despite their name, lists are more akin to arrays in other languages than to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

“despite their name” seems redundant.
“List” is datastructure independent, abstract word.
For example, C# uses IList and ArrayList for sequence (indexable). And LinkedList for linked list.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL