AlgoMaster.io (@algomaster_io) header
AlgoMaster.io (@algomaster_io) profile picture

Master DSA and System Design with visual explanations. Learn more here: https://teapaw.org/t.co/jkSAEHWpOb

Joined June 2024
Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)Photo by AlgoMaster.io (@algomaster_io)
AlgoMaster.io retweeted
๐‡๐จ๐ฐ ๐ญ๐จ ๐…๐ข๐ง๐ ๐š ๐‚๐ฒ๐œ๐ฅ๐ž ๐ข๐ง ๐š ๐‹๐ข๐ง๐ค๐ž๐ ๐‹๐ข๐ฌ๐ญ Use Floydโ€™s Cycle Detection Algorithm, also known as the slow and fast pointer technique. Start two pointers at the head: - slow moves one step at a time - fast moves two steps at a time If the linked list has no cycle, fast will eventually reach the end. If there is a cycle, fast will eventually catch up with slow inside the loop. Why does this work? Think of two runners on a circular track. If one runs faster than the other, they are guaranteed to meet eventually. Time Complexity: O(n) Space Complexity: O(1)
2
28
178
6,767
AlgoMaster.io retweeted
Tower of Hanoi - Recursion Visualization
14
230
13
2,092
387,700
AlgoMaster.io retweeted
SOLID Principles Explained with Clear Examples: ๐’ - ๐’๐ข๐ง๐ ๐ฅ๐ž ๐‘๐ž๐ฌ๐ฉ๐จ๐ง๐ฌ๐ข๐›๐ข๐ฅ๐ข๐ญ๐ฒ ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž A class should have only one reason to change. - Example: Instead of one giantย Userย class that handles authentication, profile updates, and sending emails, split it intoย UserAuth,ย UserProfile, andย EmailService. ๐Ž - ๐Ž๐ฉ๐ž๐ง/๐‚๐ฅ๐จ๐ฌ๐ž๐ ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž Classes should be open for extension but closed for modification. - Example: Define aย Shapeย interface with anย area()ย method. When you need a new shape, just add aย Circleย orย Triangleย class that implements it. ๐‹ - ๐‹๐ข๐ฌ๐ค๐จ๐ฏ ๐’๐ฎ๐›๐ฌ๐ญ๐ข๐ญ๐ฎ๐ญ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž Subtypes must be substitutable for their base types without breaking behavior. - Example: Ifย Birdย has aย fly()ย method, thenย Eagleย andย Sparrowย should both work anywhere aย Birdย is expected. ๐ˆ - ๐ˆ๐ง๐ญ๐ž๐ซ๐Ÿ๐š๐œ๐ž ๐’๐ž๐ ๐ซ๐ž๐ ๐š๐ญ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž Don't force classes to implement interfaces they don't use. - Example: Instead of one fatย Machineย interface withย print(),ย scan(), andย fax(), break it intoย Printable,ย Scannable, andย Faxable. Aย SimplePrinterย only implementsย Printable. ๐ƒ - ๐ƒ๐ž๐ฉ๐ž๐ง๐๐ž๐ง๐œ๐ฒ ๐ˆ๐ง๐ฏ๐ž๐ซ๐ฌ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž High-level modules should not depend on low-level modules. Both should depend on abstractions. - Example: Yourย OrderServiceย should depend on aย PaymentGatewayย interface, not directly onย Stripeย orย PayPal. The real power of SOLID is not in following each principle in isolation. It's in how they work together to make your code easier to change, test, and extend. โ™ป๏ธ Repost to help others in your network
8
332
3
1,636
68,419
AlgoMaster.io retweeted
If you want to get good at System Design in 1 month, learn these 30 concepts in the next 30 days: Thread (with resources) โ†ด
8
149
2
705
40,618
AlgoMaster.io retweeted
10 Must-Know Graph Algorithms for Coding Interviews: 1. ๐ƒ๐…๐’ (๐ƒ๐ž๐ฉ๐ญ๐ก-๐…๐ข๐ซ๐ฌ๐ญ ๐’๐ž๐š๐ซ๐œ๐ก) 2. ๐๐…๐’ (๐๐ซ๐ž๐š๐๐ญ๐ก-๐…๐ข๐ซ๐ฌ๐ญ ๐’๐ž๐š๐ซ๐œ๐ก) 3. ๐“๐จ๐ฉ๐จ๐ฅ๐จ๐ ๐ข๐œ๐š๐ฅ ๐’๐จ๐ซ๐ญ 4. ๐”๐ง๐ข๐จ๐ง ๐…๐ข๐ง๐ (๐ƒ๐ข๐ฌ๐ฃ๐จ๐ข๐ง๐ญ ๐’๐ž๐ญ) 5. ๐‚๐ฒ๐œ๐ฅ๐ž ๐ƒ๐ž๐ญ๐ž๐œ๐ญ๐ข๐จ๐ง 6. ๐‚๐จ๐ง๐ง๐ž๐œ๐ญ๐ž๐ ๐‚๐จ๐ฆ๐ฉ๐จ๐ง๐ž๐ง๐ญ๐ฌ 7. ๐๐ข๐ฉ๐š๐ซ๐ญ๐ข๐ญ๐ž ๐‚๐ก๐ž๐œ๐ค 8. ๐…๐ฅ๐จ๐จ๐ ๐…๐ข๐ฅ๐ฅ 9. ๐Œ๐ข๐ง๐ข๐ฆ๐ฎ๐ฆ ๐’๐ฉ๐š๐ง๐ง๐ข๐ง๐  ๐“๐ซ๐ž๐ž 10. ๐’๐ก๐จ๐ซ๐ญ๐ž๐ฌ๐ญ ๐๐š๐ญ๐ก (Dijkstra) โ™ป๏ธ Repost to help others in your network
4
131
681
21,453
AlgoMaster.io retweeted
10 must-know sorting algorithms:
4
49
314
8,083
AlgoMaster.io retweeted
If you want to master Object-Oriented Programming (OOP), consider learning these 12 concepts: 1. ๐‚๐ฅ๐š๐ฌ๐ฌ 2. ๐Ž๐›๐ฃ๐ž๐œ๐ญ 3. ๐ˆ๐ง๐ญ๐ž๐ซ๐Ÿ๐š๐œ๐ž 4. ๐„๐ง๐œ๐š๐ฉ๐ฌ๐ฎ๐ฅ๐š๐ญ๐ข๐จ๐ง 5. ๐€๐›๐ฌ๐ญ๐ซ๐š๐œ๐ญ๐ข๐จ๐ง 6. ๐ˆ๐ง๐ก๐ž๐ซ๐ข๐ญ๐š๐ง๐œ๐ž 7. ๐๐จ๐ฅ๐ฒ๐ฆ๐จ๐ซ๐ฉ๐ก๐ข๐ฌ๐ฆ 8. ๐€๐ฌ๐ฌ๐จ๐œ๐ข๐š๐ญ๐ข๐จ๐ง 9. ๐€๐ ๐ ๐ซ๐ž๐ ๐š๐ญ๐ข๐จ๐ง 10. ๐‚๐จ๐ฆ๐ฉ๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง 11. ๐ƒ๐ž๐ฉ๐ž๐ง๐๐ž๐ง๐œ๐ฒ 12. ๐‘๐ž๐š๐ฅ๐ข๐ณ๐š๐ญ๐ข๐จ๐ง (๐ˆ๐ฆ๐ฉ๐ฅ๐ž๐ฆ๐ž๐ง๐ญ๐š๐ญ๐ข๐จ๐ง) Which other OOP concept would you add to this list? โ™ป๏ธ Repost to help others learn this
9
265
5
1,363
49,433