-
-
Save IndhumathyChelliah/6653414c8ccc3c5ac8a0b33c33ad40c9 to your computer and use it in GitHub Desktop.
This file contains 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
OrderedDict | Dict | |
---|---|---|
Good at reordering operations | Good at mapping operations | |
Space efficiency, iteration speed, and the performance of update operations were secondary | Tracking insertion order was secondary. | |
OrderedDict has a move_to_end() method to efficiently reposition an element to an endpoint | That feature is not available in dict | |
reversed() function is supported | Not supported till python version 3.8 | |
Equality operation checks for matching order | Mappings (instances of dict) compare equal if and only if they have equal (key, value) pairs | |
popitem() accepts optional argument to specify which item to be popped | popitem() removes and returns the last inserted item(key,value) from the dictionary. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment