DEV Community

xscoox
xscoox

Posted on

πŸš€ Day 2 of #100DaysOfCode – Mastering Binary Search in TypeScript

Hey Devs! πŸ‘‹

Today, I deep-dived into Binary Search and explored some interesting problems using TypeScript. Here's what I worked on:

πŸ” What I Learned:
βœ… Binary Search in Depth – Understanding the intuition behind it
βœ… Floor & Ceil in a Sorted Array – Using Binary Search efficiently
βœ… Recursive Approach – Improved understanding of recursion while implementing

🧩 Floor & Ceil Problem:
➑️ Floor: Largest element ≀ target
➑️ Ceil: Smallest element β‰₯ target

Image description

Image description

πŸ”₯ Key Takeaways:
➑️ Binary Search makes floor & ceil problems efficient.
➑️ Iterative & Recursive approaches both provide valuable insights.
➑️ Understanding edge cases is crucial, like when the target is smaller/larger than all elements.

I’m really enjoying this challenge so far! Next up, I plan to explore strivers DSA sheet and searching in rotated sorted arrays.

πŸ’‘ What are your thoughts on my implementation? Any improvements or alternative approaches? Let’s discuss!

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)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post