DEV Community

Adhyan Jain
Adhyan Jain

Posted on

Week 4 of C++: Revision & Problem-Solving

This week was focused on revising pointers and structures, along with exploring two-pointer techniques and Floyd’s cycle detection theorem. I also participated in 6 contests across Codeforces, AtCoder, CodeChef, and LeetCode, improving my problem-solving under time constraints.

🔹Pointers Revision (Day 22-24)

I spent the first three days revisiting pointers, covering:

  • Pointer arithmetic and how it interacts with arrays
  • Function pointers and their applications
  • Common mistakes like memory leaks and segmentation faults

This helped solidify concepts essential for memory management and performance optimization.

🔹Two-Pointer & Cycle Detection (Day 25)

Day 25 was dedicated to learning the two-pointer technique and Floyd’s cycle detection theorem:

  • Two-pointer approach helps optimize problems involving sorted arrays, searching, and merging.
  • Floyd’s Tortoise and Hare Algorithm is useful for detecting cycles in linked lists efficiently.

Both techniques are widely used in competitive programming and provide significant time complexity improvements.

🔹Structures Revision (Day 26 & 28)

I revised structures and their applications, including:

  • Arrays of structures
  • Nested structures
  • Pointers to structures

This was a quick refresher, as structures are fundamental for organizing complex data and transitioning into OOP.

🔹Problem-Solving & Contests (Day 27)

Day 27 was all about applying concepts in real problems. I solved challenges on Codeforces and worked on:

  • Two-pointer-based problems
  • Cycle detection in linked lists
  • Structuring data efficiently in problem-solving

Regular practice is helping me improve both speed and accuracy in coding contests.

🔹Key Takeaways

  • Pointers and structures are foundational concepts that need strong command.
  • Two-pointer and cycle detection techniques significantly optimize problem-solving.
  • Consistent contest participation enhances coding speed and adaptability.

🔹What’s Next?

Next week, I plan to:

  • Solve more competitive programming problems
  • Explore additional optimization techniques

🔹Connect With Me

Check out my work here:

Have you used the two-pointer approach before? Let’s discuss in the comments!

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay