An Interest In:
Web News this Week
- March 17, 2024
- March 16, 2024
- March 15, 2024
- March 14, 2024
- March 13, 2024
- March 12, 2024
- March 11, 2024
March 12, 2020 08:47 pm GMT
Original Link: https://dev.to/misselliev/easy-as-a-pie-big-o-notation-a-note-about-objects-3gn9
Easy as a pie Big O notation: A note about Objects
An object is an unordered data structure where everything is stored in key-value pairs.
Let superDog = {Name: Dulce,Breed: Chihuahua,Weight: 2 pounds }
Objects are great when storing in order is not a concern and we need to be fast at inserting and removing data.
But exactly, how fast?
- Insertion: O(1)
- Removal: O(1)
- Access: O(1)
- Searching: O(N)
It works in constant time because since we have no order in our data, we technically dont have a beginning or end so it doesnt really matter in which order data is added.
Got something to add? Please feel free to reach out for any question, comment or meme.
Original Link: https://dev.to/misselliev/easy-as-a-pie-big-o-notation-a-note-about-objects-3gn9
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To