Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found…
Browsing: Data Structures & Algorithms
For a sorted array a[] of length n and a value x, you must return both: If either does not…
Given a sorted array of distinct integers and a target value, return the index if the target is found. If…
In a sorted array arr[], the upper bound of x is the index of the first element that is strictly…
Given a sorted array arr[] and an integer x, find the index (0-based) of the largest element in arr[] that is less than…
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then…
You’re given an integer array nums of length n.An element is called a majority element II if it appears strictly…
Given an array arr[] of size n, an element is called an Array Leaders if it is greater than or…
The “Majority Element” problem (LeetCode #169) asks you to find the value that appears strictly more than ⌊ n /…
LeetCode “Sort Colors” (#75) asks you to sort an array that contains only three distinct values—0, 1, and 2—so that…