Binary Search Algorithm in Java: Finding and Insertion Position

#100DaysOfCode 👉 LeetCode #35 – Search Insert Position Binary Search is not just about finding elements 👀 🔹 Idea: Applied Binary Search on a sorted array. If the target is found, return its index. If not found, the `left` pointer itself gives the correct position where the element should be inserted. Time Complexity: O(log n) Space Complexity: O(1) ✔ Strengthened binary search intuition   ✔ Understood pointer movement deeply   ✔ Learned how insertion logic naturally emerges from search 💡 Takeaway: Binary Search answers more than “found or not” — it also tells where something belongs. Building strong DSA fundamentals in Java, one problem at a time. Open to feedback and better approaches 👋 Day 9 ✅ #LearnInPublic #100DaysOfCode #DSA #Java #BinarySearch #ProblemSolving #SoftwareEngineer #CodingJourney #Consistency

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories