DEV Community

Fernando Doglio
Fernando Doglio

Posted on

3

What's your favorite data structure?

I find myself finding ways to use or implement variations of hash maps in my code, mainly because I love being able to perform an O(1) lookup of what I want to find.

What about you? What is your favorite data structure and why?

Top comments (4)

Collapse
 
healeycodes profile image
Andrew Healey

I like tries because it's a simple example of a tree-like structure you use every day (e.g. dictionary/spellchecker).

Although, these applications might be using DAFSA..

Collapse
 
deleteman123 profile image
Fernando Doglio

Cool! I wasn't aware of that one! Thanks for sharing :)

Collapse
 
dcboddie profile image
David Boddie

I like dictionaries/hashes, the key/value pair seems to work best for me. And with Javascript, you can place a function, object or array as the value! That just feels really powerful.

Collapse
 
deleteman123 profile image
Fernando Doglio

100% agree!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more