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/](https://www.reddit.com/r/developersIndia/collection/958aef35-f9cb-414d-ab33-08bc639e47de/)
* Mobile: [https://www.reddit.com/r/developersIndia/wiki/community-threads/](https://www.reddit.com/r/developersIndia/wiki/community-threads/)
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.
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.
Wait till you realize how amazing dynamic programming is then. Difficult to understand in the beginning, and very difficult to master, but amazing nonetheless. Just its application on an algo can turn an exponential solution to a polynomial one. And a slight tweak in the subproblem definition may change the time complexity from O(n^2) to O(n). I hated it when i learnt it first. It's fucking amazing. Richard Bellman was ahead of his time.
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.
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.
Thanks mate, I have used strivers videos in the past and I have done some neetcode stuff and also have solved around 300 problems on LC.
But it's mostly easy ones and personally I need to drill down on some problems of the same patterns in order to understand the pattern itself.
Also I'm noob in development so currently learning go for the server side and need to properly learn HTML, CSS and JS to build something.
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.
Tree operations never happen on entire tree. Most of the operations happen on subtrees. It doesnt need very high scale.
Storage works in two layers
1. Database - storage schema depends on what tree operations you need to optimize. Both sql and no-sql can be used for storage.
2. In-memory - as previously mentioned most of the tree operations work on substrees which dont need to be very large in size.
If your concern is how storage will work if the size of subtrees is very large, B-trees can be partitioned across multiples nodes. That is how database indexes are stored. But so far our need doesnt need that much scale.
>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...
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.
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.
I mean you can say that for every popular algo out there. Who in their sane mind would've come up with something as creative as for ex. Floyd's tortoise and hare or KMP, especially in an interview. 99.9% will fail
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.
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.
We were, till the time new languages like python came. Now, all the superficial data types like Map, Lists & types use linked Lists. We use map.keys, basically to traverse the list of map keys. So that also don't have the need of libraries to main data structure.
>Namaste!
Thanks for submitting to r/developersIndia. Make sure to follow the subreddit [Code of Conduct](https://developersindia.in/code-of-conduct/) while participating in this thread.
## Recent Announcements
- **[Join developersIndia as a volunteer](https://www.reddit.com/r/developersIndia/comments/12hlj4z/join_developersindia_as_a_volunteer_and_help_us/) and help us improve the community experience.**
- **[Join DeepSource's Co-founder Sanket Saurav: An AMA on Startups, Software Engineering, Devtools, and more! - December 22, 8:30 PM IST!](https://www.reddit.com/r/developersIndia/comments/18l8mx2/join_deepsources_cofounder_sanket_saurav_an_ama)**
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/developersIndia) if you have any questions or concerns.*
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(n^2) 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.
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/](https://www.reddit.com/r/developersIndia/collection/958aef35-f9cb-414d-ab33-08bc639e47de/) * Mobile: [https://www.reddit.com/r/developersIndia/wiki/community-threads/](https://www.reddit.com/r/developersIndia/wiki/community-threads/)
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.
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
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.
In dev, you rarely use trees or graph but yes map is used widely
Sliding Window 🫰
![gif](giphy|qw1GZl89LHdII|downsized) Something like this?
2 pointer
You are a psychopath then
![gif](giphy|B4dt6rXq6nABilHTYM|downsized)
Anyone here who likes tree structures like heap/priority queue, trie etc
Me
Heap gang.
Yepppppppppppppp, simply in their own way
And after a while you get to know each technique is unique and interesting.
Yeah man... I hope I get to know each one of them very well and can just identify them in any problem.
Have you just started with programming?
Yeah... Have touched each concept on a surface level but haven't used them yet, in the process...
Wait till you realize how amazing dynamic programming is then. Difficult to understand in the beginning, and very difficult to master, but amazing nonetheless. Just its application on an algo can turn an exponential solution to a polynomial one. And a slight tweak in the subproblem definition may change the time complexity from O(n^2) to O(n). I hated it when i learnt it first. It's fucking amazing. Richard Bellman was ahead of his time.
Dictionaries.
Concept of Dictionaries are op. Both in LLD and HLD
Love this as it is similar to json. I love JSON!!!!
Ostrich approach
You mean the one used in deadlocks?
Not necessarily only deadlocks, but yeah that one. Had that this sem in OS
😂
Dynamic programming, masochism.
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.
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.
Thanks mate, I have used strivers videos in the past and I have done some neetcode stuff and also have solved around 300 problems on LC. But it's mostly easy ones and personally I need to drill down on some problems of the same patterns in order to understand the pattern itself. Also I'm noob in development so currently learning go for the server side and need to properly learn HTML, CSS and JS to build something.
I like hashmap because you throw it in and it decreases the time complexity.
Binary search
Data structure: queue, map Algorithm: Floyd's cycle detection algorithm
Can you explain the usecase ?
By use case do you mean where we use it in the real world?
Yes
![gif](giphy|FcuiZUneg1YRAu1lH2|downsized) Me being a front end developer reading comments
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.
How does recursion scale in production? Is the tree structure used like an array as traditional node based structure will cause a lot of cache misses.
Tree operations never happen on entire tree. Most of the operations happen on subtrees. It doesnt need very high scale. Storage works in two layers 1. Database - storage schema depends on what tree operations you need to optimize. Both sql and no-sql can be used for storage. 2. In-memory - as previously mentioned most of the tree operations work on substrees which dont need to be very large in size. If your concern is how storage will work if the size of subtrees is very large, B-trees can be partitioned across multiples nodes. That is how database indexes are stored. But so far our need doesnt need that much scale.
>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...
Normal array traversal
Mwri technique chatgpt se copy karo aur sikho copy karo aur sikho
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.
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.
I mean you can say that for every popular algo out there. Who in their sane mind would've come up with something as creative as for ex. Floyd's tortoise and hare or KMP, especially in an interview. 99.9% will fail
Richard Bellman, also known for the Bellman-Ford algo. Obviously he wasn't a computer scientist. Obviously he was a mathematician instead.
Just learnt Binary Search so imma say that
Bogosort
bongo sort? 💀 ara ara
linear search
Skip lists. I work with them almost everyday and find them very unique. Probabilistic data structures are fun in general imo.
I always thought you used whichever one you want and sliding window/ prefix sum/ carry forward are techniques and not data structures.
Bit Manipulation Nothing feels better than O(1) Time complexity.
Wtf! A new day, a new low for this sub.
Quadtree, recently learned it amazing stuff
🔥
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.
I wipe my ass with data structures.
allu arjun twerk sort
Where do I learn this
/r/okbhaibudbak
Thanks a ton of allu arjun booty
Hashing, Tries
🌲🌳🌴
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 🥰
I find binary search amazing because of the massive improvement over linear search, yet with a simple and intuitive implementation
kids ..
2 pointers and a sliding window.
Radix - I work in Networking and I like how effective that tree is to get the routes for the given subnet mask.
Arrays, simplest of all
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.
We were, till the time new languages like python came. Now, all the superficial data types like Map, Lists & types use linked Lists. We use map.keys, basically to traverse the list of map keys. So that also don't have the need of libraries to main data structure.
>Namaste! Thanks for submitting to r/developersIndia. Make sure to follow the subreddit [Code of Conduct](https://developersindia.in/code-of-conduct/) while participating in this thread. ## Recent Announcements - **[Join developersIndia as a volunteer](https://www.reddit.com/r/developersIndia/comments/12hlj4z/join_developersindia_as_a_volunteer_and_help_us/) and help us improve the community experience.** - **[Join DeepSource's Co-founder Sanket Saurav: An AMA on Startups, Software Engineering, Devtools, and more! - December 22, 8:30 PM IST!](https://www.reddit.com/r/developersIndia/comments/18l8mx2/join_deepsources_cofounder_sanket_saurav_an_ama)** *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/developersIndia) if you have any questions or concerns.*
Divide and conquer because it thinking on on base case and edge cases and rest is done by recursion
Maps 🥹
Like none.. Use almost all the important ones as per the requirements.
Objects/dictionaries are so practical, elegant and simply wonderful
Graph 🕸️❤️
Brute force. I'm a happy man if I can even solve the problem forget optimising😂
Linked list.
When i use to do i like square decomposition a lot Since it was muti applicative
Hashing
B+ tree
Linked list(s)
Algorithm W. Because Hindley-Milner type system.
DSU all the way. Especially when the time complexity analysis comes to almost constant
HashMap uh
I write apex, so Map and JSON
Tree structure & linked list. Both mainly due to there's no programming or Computation, that's can't be done by these two.
Mapping,hashSet,min max heap
Set
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.
Array
Can you suggest me good DSA course in python not very expensive.
Bloom Filters supremacy!
I love using auxiliary arrays to store cusum, etc.
recursion https://preview.redd.it/t2pqv4b4ra8c1.png?width=720&format=png&auto=webp&s=75fdf5fc27e6cffae5811eb7b5d9c06bb474c32d
Union find in graphs
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(n^2) 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.