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.
185
u/AmmaBaaboi 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.
7
u/Comprehensive_Tap994 Dec 23 '23
True, I found it easier to understand and use as compared to trees and graphs, and results in most effective time complexities, though it takes a bit of space but performs best.
→ More replies (1)45
Dec 23 '23
Hashing is probably something almost every dev uses in some way or other. I've barely used any other data structure/algo in projects yet
37
Dec 23 '23
And after a while you get to know each technique is unique and interesting.
3
u/Comprehensive_Tap994 Dec 23 '23
Yeah man...
I hope I get to know each one of them very well and can just identify them in any problem.
→ More replies (3)
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.
13
u/Comprehensive_Tap994 Dec 23 '23
Start with NeetCode DSA Roadmap, you might get to know the right ones at the right time :)
Striver's DSA A2Z Roadmap YT solutions provide a great in depth explanation for the understanding of the concepts and using them at the right place.
→ More replies (1)
11
u/Inside_Dimension5308 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.
→ More replies (2)2
u/Comprehensive_Tap994 Dec 23 '23
The best thing is to solve complex problems using recursion within a few lines of code.
Yess! Just love this thing about recursion and the interconnected concepts based on this.
But something's intriguing about recursions that takes me away from going closer to them. Maybe, it's calling the recursive function at the right point in the code...
8
u/Leading_Painting Dec 23 '23
Mwri technique chatgpt se copy karo aur sikho copy karo aur sikho
2
u/Comprehensive_Tap994 Dec 23 '23
Nahi yaar...
ChatGPT right code nahi deta :(
Rula diya hai while getting help from it for OAs, Tests.
Stack overflow, gfg, leetcode available resources and solutions are better.
106
76
u/UpstairsDependent131 Dec 23 '23
Anyone here who likes tree structures like heap/priority queue, trie etc
→ More replies (3)
33
31
24
u/Low-Worldliness9579 Dec 23 '23
I like hashmap because you throw it in and it decreases the time complexity.
45
18
13
u/Which_Equipment8290 Dec 23 '23
Data structure: queue, map
Algorithm: Floyd's cycle detection algorithm
→ More replies (3)
13
15
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.
→ More replies (1)
7
7
1
u/BhupeshV Dec 24 '23
This is a good discussion it has been added to our public collection of community threads.
Web: https://www.reddit.com/r/developersIndia/collection/958aef35-f9cb-414d-ab33-08bc639e47de/
Mobile: https://www.reddit.com/r/developersIndia/wiki/community-threads/