Sets and maps made from AVL trees. They embody the beauty of binary search.
Priority queues (no matter the implementation). I think they are elegant and bring that elegance to the algorithms they appear in.
Matrices. For me, they are difficult to understand, but their versatility seem to be endless! Graphs and automata, neural networks, geometry for robotics and videogames, everything in computer vision... they're just everywhere!
Simple, versatile, efficient and easy to implement.
Used in almost every computer program and provides a very easy way for manipulation of a collection of similar elements (irrespective of time complexity and algorithmic analysis).
P.S : If you are coming from a Java background, you feel DSA is quite conceptual and brilliant subject if you work with Java.
i love tries! got introduced into those in cs50 and did a "real" implementation in the ml course at my uni. Have been in love with them ever since. In a trie - its like every node you navigate to makes up a piece of information (sort of like a treasure hunt where each step leads to the next clue and so on) and by the end - u retrieve the full information! super exiting :)
HashMaps and Linked Hashset.
But I love the array in PHP.
They cover so much, they are Hashmaps, Hashsets, ordered Maps, Stacks(derived), Queues(derived) and of course, arrays too :P
Personally I love hashmaps, they are an elegant way to quickly and efficiently store unsorted data in an organized fashion. I typically use them in situations such as spatial hashing, which makes many of my collision based algorithms so much more efficient. I also use them for situations where I need only one of each type, as hashmaps can only have a single key to value relationship. Overall their O(1) nature and their intrinsic properties make them a favorite for me!
My favourite data structure is the one that gets the job done efficiently. /joke
To give a serious answer, my most used, and therefore most often favourite would be a map. Knowing the various underlying implementations is really fun and important in order to make a good performance decision.
I'm Calin Baenen – AKA KattyTheEnby – a programmer born October 30th, 2006.
I love programming, it has been my passion since I was a kid, and will forever be my passion.
Top comments (14)
My favorite data structure is the Array.
P.S : If you are coming from a Java background, you feel DSA is quite conceptual and brilliant subject if you work with Java.
i love tries! got introduced into those in cs50 and did a "real" implementation in the ml course at my uni. Have been in love with them ever since. In a trie - its like every node you navigate to makes up a piece of information (sort of like a treasure hunt where each step leads to the next clue and so on) and by the end - u retrieve the full information! super exiting :)
HashMaps and Linked Hashset.
But I love the array in PHP.
They cover so much, they are Hashmaps, Hashsets, ordered Maps, Stacks(derived), Queues(derived) and of course, arrays too :P
Personally I love hashmaps, they are an elegant way to quickly and efficiently store unsorted data in an organized fashion. I typically use them in situations such as spatial hashing, which makes many of my collision based algorithms so much more efficient. I also use them for situations where I need only one of each type, as hashmaps can only have a single key to value relationship. Overall their O(1) nature and their intrinsic properties make them a favorite for me!
My favourite data structure is the one that gets the job done efficiently. /joke
To give a serious answer, my most used, and therefore most often favourite would be a map. Knowing the various underlying implementations is really fun and important in order to make a good performance decision.
I found this site helpful in visualising the various algorithms and data structures cs.usfca.edu/~galles/visualization...
Right Now, it's Stack. I only know two, Stack and Queue.
Why Stack ? coz it pops well. :)
😂🤩👏
HashMap (
<String, Object>
obviously).Basic immutable and enumerable collection. Often all you need.
Definitely Array 😄