Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 12, 2020 08:47 pm GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To