r/DSALeetCode • u/Shiven2007goyal • 18h ago
Contestssss:(
What according to u is the best time to start taking up contests. I recently gave one and got totally smooshed. RECOMMENDATIONS PLSS!!!!
r/DSALeetCode • u/Shiven2007goyal • 18h ago
What according to u is the best time to start taking up contests. I recently gave one and got totally smooshed. RECOMMENDATIONS PLSS!!!!
r/DSALeetCode • u/Shiven2007goyal • 23h ago
Started following strivers a to z DSA playlist a month ago. Initially it felt easy but now feels more like a burden. Cant comeup with an optimal solution on my own. I canโt recognise the pattern and then end up seeing solution โฆwhat would u all suggest me...
r/DSALeetCode • u/Sea-Ad7805 • 17h ago
Enable HLS to view with audio, or disable this notification
The same tree represented in two very different ways visualized using ๐บ๐ฒ๐บ๐ผ๐ฟ๐_๐ด๐ฟ๐ฎ๐ฝ๐ต: Binary Trees
๐ Binary Tree as Nodes: The tree is built out of multiple node objects. Each node stores its value and two references, one to its left child and one to its right child.
๐ฆ Binary Tree as List: The tree is stored in a single list or array. Instead of references, indices represent the relationships between nodes. For a node at index, its children can be found using a simple calculation: - Left child: 2 * index + 1 - Right child: 2 * index + 2
So, when should you use which representation?
The node-based version makes the structure explicit and intuitive. It is great for education: students can clearly see how nodes are connected while practicing classes and references/pointers. It is flexible and works particularly well for irregular or sparse trees. It is the clearest representation when learning how trees work.
The list-based version can be very efficient for (nearly) balanced trees. It does not need to store child references, requires fewer separate memory allocations, and keeps values close together in memory for improved cache performance.
The same abstract data structure, but with very different trade-offs in clarity, flexibility, and performance.
Which representation would you use?
r/DSALeetCode • u/Top-Chocolate5546 • 2h ago
Hi everyone!
I'm a Software Engineer with around 1.5 years of experience and I'm starting my preparation to switch to a product-based company.
I'm looking for a serious accountability partner, preferably from Bangalore, who's also preparing for product company interviews and is committed to staying consistent.
About me:
Currently working at a service-based company
Language: Java
Time Zone: IST (India)
Current level: Comfortable with basic DSA
Goal: Crack product company interviews in the next 3โ4 months
Plan:
Solve DSA problems consistently
Discuss approaches and optimizations
Keep each other accountable
We can decide the exact schedule and roadmap together based on what works best for both of us.
If you're genuinely committed and interested, feel free to DM me.
r/DSALeetCode • u/sam_312007 • 15h ago
Help me how to learn patterns from any questions