r/developersIndia • u/Comprehensive_Tap994 • Dec 23 '23
General Which Data Structure or technique do you like the most and why ?
Currently, I find two pointers technique most interesting because it does not take any space and ends up upto linear time in the worst case ig.
225
Upvotes
•
u/BhupeshV Moderator Dec 24 '23
This is a good discussion it has been added to our public collection of community threads.
185
u/AmmaBaaboi Software Engineer Dec 23 '23
I feel it's hashing, simple yet elegant. It gave rise to diff structures, hashmap and sets, and techniques built on top of it like bloom filters. Pretty amazing as we go down into it and see it's usecases.
37
u/[deleted] Dec 23 '23
And after a while you get to know each technique is unique and interesting.
22
u/DarkRaiden72 Dec 23 '23
As many others have said, hashing, two pointers (fast and slow pointers when working with Linked lists), sort and search, etc., I haven't fully mastered DSA yet so still a long way to go.
11
u/Inside_Dimension5308 Tech Lead Dec 23 '23
Tree structure is probably used data structure in our company whether it is storing parent-child relationships or dependency tree. The best thing is to solve complex problems using recursion within a few lines of code.
8
u/Leading_Painting Dec 23 '23
Mwri technique chatgpt se copy karo aur sikho copy karo aur sikho
106
u/[deleted] Dec 23 '23
Sliding Window 🫰
76
u/UpstairsDependent131 Software Engineer Dec 23 '23
Anyone here who likes tree structures like heap/priority queue, trie etc
33
u/Level-Arrival7447 Dec 23 '23
Dictionaries.
31
u/Rishabh_0507 Dec 23 '23
Ostrich approach
24
u/Low-Worldliness9579 Dec 23 '23
I like hashmap because you throw it in and it decreases the time complexity.
45
u/CuummRAG Dec 23 '23
Dynamic programming, masochism.
18
u/Beginning_Fortune_92 Dec 23 '23
Binary search
13
u/Which_Equipment8290 Dec 23 '23
Data structure: queue, map
Algorithm: Floyd's cycle detection algorithm
13
u/desimemewala Dec 23 '23
Me being a front end developer reading comments
15
u/[deleted] Dec 23 '23
Dynamic programming 🔥 A big salute to the guy who observed the fact that instead of calculating the function every time it was called, we can store the value of the function and use it when we need that function in future.
7
u/mystical_apple05 Student Dec 23 '23
Just learnt Binary Search so imma say that
7
u/shitcoin_farmer Dec 23 '23
Bogosort
5
u/lofi_thoughts Dec 23 '23
linear search
5
u/parad0xis Software Engineer Dec 23 '23
Skip lists. I work with them almost everyday and find them very unique. Probabilistic data structures are fun in general imo.
4
u/[deleted] Dec 23 '23
I always thought you used whichever one you want and sliding window/ prefix sum/ carry forward are techniques and not data structures.
4
u/Fine_Foundation_4803 Dec 23 '23
Bit Manipulation
Nothing feels better than O(1) Time complexity.
4
u/[deleted] Dec 24 '23
Wtf! A new day, a new low for this sub.
3
u/doma_kun Dec 23 '23
Quadtree, recently learned it amazing stuff
3
u/_always_alive_ Dec 23 '23
I'm surprised no-one mentioned it, but I find Trie quite intriguing. Yeah it's a form of a tree, but not just a tree, a tree plus an array as one might go deeper.
3
u/[deleted] Dec 24 '23
I wipe my ass with data structures.
6
u/friendlymonkey_55 Dec 23 '23
allu arjun twerk sort
2
u/code_rag Frontend Developer Dec 23 '23
Hashing, Tries
2
u/Whatisanoemanyway Data Scientist Dec 23 '23
🌲🌳🌴
2
u/Possibility-Puzzled Software Engineer Dec 23 '23
Trie was my first love. That’s the first complex data structure I learnt ever. It’s simple, extremely powerful, painless to implement, very cute 🥰
2
u/RollingRocky360 Student Dec 24 '23
I find binary search amazing because of the massive improvement over linear search, yet with a simple and intuitive implementation
2
u/[deleted] Dec 24 '23
kids ..
2
u/No_Helicopter_3751 Dec 24 '23
2 pointers and a sliding window.
2
u/Free-Adhesiveness-69 Dec 24 '23
Radix - I work in Networking and I like how effective that tree is to get the routes for the given subnet mask.
1
u/Super-Commercial6445 Dec 23 '23
Arrays, simplest of all
1
u/AutoModerator Dec 23 '23
Recent Announcements
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/S0ulDes8ny Dec 23 '23
Divide and conquer because it thinking on on base case and edge cases and rest is done by recursion
1
u/smeazy_ Dec 23 '23
Maps 🥹
1
u/Hermitcrabguy Product Manager Dec 23 '23
Like none.. Use almost all the important ones as per the requirements.
1
u/plushdev Dec 23 '23
Objects/dictionaries are so practical, elegant and simply wonderful
1
u/Leading-Formal-4035 Dec 23 '23
Graph 🕸️❤️
1
u/MugiwaranoAK Data Analyst Dec 23 '23
Brute force. I'm a happy man if I can even solve the problem forget optimising😂
1
u/faltugiribuster Dec 23 '23
Linked list.
1
u/tequila_triceps Dec 23 '23
When i use to do i like square decomposition a lot Since it was muti applicative
1
u/[deleted] Dec 23 '23
Hashing
1
u/HarlotsLoveAuschwitz Dec 23 '23
B+ tree
1
u/bum_quarter Senior Engineer Dec 23 '23
Linked list(s)
1
u/nxnt Dec 23 '23
Algorithm W. Because Hindley-Milner type system.
1
u/Life_Vast801 Dec 23 '23
DSU all the way. Especially when the time complexity analysis comes to almost constant
1
u/OmniTron_Bot Full-Stack Developer Dec 23 '23
HashMap uh
1
u/Due-Conclusion-6753 Dec 23 '23
I write apex, so Map<String, Object> and JSON
1
u/__I_S__ Dec 23 '23
Tree structure & linked list. Both mainly due to there's no programming or Computation, that's can't be done by these two.
1
u/BuyMiserable6589 Dec 24 '23
Mapping,hashSet,min max heap
1
u/Empty_Somewhere3089 Dec 24 '23
Set
1
u/iHaveFiveCookies Dec 24 '23
I don't have a fav data structure but I like divide n conquer and memorization a lot, prolly cause I use them in my life a lot.
1
u/IamBatmanKnight Dec 24 '23
Can you suggest me good DSA course in python not very expensive.
1
u/Live-Key8030 Dec 24 '23
Bloom Filters supremacy!
1
u/noxwon Dec 24 '23
I love using auxiliary arrays to store cusum, etc.
1
u/[deleted] Dec 24 '23
recursion
1
u/sparshgunner12 Dec 24 '23
Union find in graphs
1
u/Redder_Reddit_User Dec 25 '23
Small to large merging technique (a part of DSU). I find the core idea so amazing and unintuitive (Although I'm well fimiliar with mathematical proof of it). To merge 2 sets by simply iterating over the smaller set and inserting its elements into bigger set can turn O(n2) into O(nlogn) as each element will be iterated upon at most O(logn) times.
This is so unintuitive, such a simple change, brings a huge optimisation in running time. This rarely happens.
1
u/[deleted] Dec 23 '23
Array is the mainly the data structure you may use very often. Rest are very seldom and depends on the thing you work. Regarding sear/sort there are libraries that does it for you and you may never implement one.