Day 11: Binary Search (LeetCode 704) - Fast Search in Sorted Array (O(log n))
Автор: Ashwini Kemshetty
Загружено: 2026-01-17
Просмотров: 11
Описание:
🎯 Day 11 of My LeetCode Journey | Binary Search (LeetCode 704)
In this video, I solve LeetCode Problem #704 - Binary Search. This is a must-know interview pattern for searching in a sorted array efficiently using O(log n) time.
🔗 Problem Link: https://leetcode.com/problems/binary-...
📌 PROBLEM SUMMARY:
Given a sorted array nums and an integer target, return the index of target if it exists. Otherwise, return -1.
You must solve it in O(log n) runtime.
Example 1:
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4
Example 2:
Input: nums = [-1,0,3,5,9,12], target = 2
Output: -1
💡 KEY CONCEPTS:
✅ Binary Search Pattern
✅ Two Pointers (low/high)
✅ Mid computation & boundary handling
✅ O(log n) time complexity
📊 COMPLEXITY:
• Time: O(log n)
• Space: O(1) iterative
🎓 DIFFICULTY: Easy
🏷️ TOPICS: Array, Binary Search
🔔 SUBSCRIBE for daily LeetCode solutions and coding challenges!
👍 LIKE if you found this helpful!
💬 COMMENT your approach or questions below!
📚 MY LEETCODE JOURNEY PLAYLIST:
• Leetcode
🤝 CONNECT WITH ME:
• GitHub: https://github.com/ashwinikemshetty
• LinkedIn: / ashwinikemshetty
---
#LeetCode #BinarySearch #LeetCode704 #Day11 #CodingInterview #DSA #Algorithms #Ologn #Programming #100DaysOfCode
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: