10 posts about sorted array by 7 contributors.
Know sorted array? Share what you know with developers who are learning it.
This article explains how to efficiently find the kth missing positive number in a sorted array. Using the insight that the number of missing numbers before an index i is arr[i] - (i+1), the problem can be solved with binary search, reducing time complexity from O(n + k) to O(log n). The article includes step-by-step examples and a clear Java implementation.
Master binary search to find the single, unpaired element in a sorted array! Learn the logic, code, and common mistakes to ace your coding interviews. O(log n) efficiency.
Master counting element occurrences in sorted arrays efficiently using Binary Search! This guide provides a step-by-step approach, code examples, and avoids common mistakes. Ace your coding interviews!
Master binary search! Efficiently find the first and last positions of an element in a sorted array. Ace coding interviews with this essential algorithm. O(log n) speed!
Master the art of efficiently locating the last occurrence of an element within a sorted array! This guide explores both brute-force and optimized binary search approaches, providing a C++ implementation and a detailed dry run. Learn how to modify binary search to pinpoint the last instance of a target value, even with duplicates, achieving O(log n) time complexity. Perfect for algorithm enthusiasts and coding interview prep!
This article provides a step-by-step approach, complete with a C code implementation, example dry run, and complexity analysis. Optimize your DSA skills and ace those coding interviews by understanding this essential technique. Learn how to adapt binary search for finding the leftmost instance, ensuring optimal performance in O(log n) time.
Learn how to calculate the median of a pre-sorted Python list in O(1) time, including odd, even, empty, and salary-data examples.
Learn how Interpolation Search improves upon Binary Search for uniformly distributed, sorted arrays. Explore its working, code examples in Java, performance, use cases, and comparison with Binary Search. 2/2
The Two Pointer Approach is one of the most used and efficient techniques to search for a pair in a sorted array. We'll look into the working of it, implementation and use cases.
Count Sort is Linear Sorting algorithm which sorts elements in O(n) time , the other linear sorts include Bucket and Radix sorts.
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterPublish an article in this category and earn +1,000 SHARP when it is approved.
Write an article