hardStudy question · answer published in Data Structures and Algorithms interview questions, so no pointssorting-and-searching
Place items to maximise the minimum gap
Stalls are at positions [1, 2, 4, 8, 9]. You must place 3 cows in stalls so that the smallest distance between any two cows is as large as possible. What is that distance?
Discussion 0
Join free to post in the discussion.
Related questions
- Bubble sort best case with early exitBackend Developer
- What a stable sort meansBackend Developer
- Merge sort time in every caseBackend Developer
- Best simple sort for nearly sorted dataBackend Developer
- Swaps made by selection sortBackend Developer
- What in-place sorting meansBackend Developer
- Quick sort worst-case timeBackend Developer
- JavaScript default sort on numbersBackend Developer