Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
221 views

Counting duplicate elements in two sorted arrays

I've been working on an assignment that involves optimizing a duplicate finding algorithm for sorted arrays, and I'd like to get your thoughts on the implementation. Here's the code I've come up with: ...
Bryan C's user avatar
  • 31
5 votes
3 answers
788 views

Searching an element in an alternately sorted array

I had to write some code that receives a number 'x' and an alternately sorted array (an array with all even indexes sorted upwards and all odd indexes sorted downwards) and checks if 'x' exists in the ...
RedYoel's user avatar
  • 311
1 vote
1 answer
96 views

Getting partition boundaries in sorted integer array using only equalTo operator

For my task, I need to find partition boundaries in sorted input. Values are expected to be repeated, I just need to find range for each value. Please check comment in following output for example. ...
Lance Reynolds's user avatar
3 votes
1 answer
168 views

Find the minimum value in a circular list of integers

I was looking up some coding challenges and this looked like a fun one to solve. I tested it with the following values and it seems to work for those at least: [ 5, 7, 8, 9, 11, 2, 3 ] [ 5, 7, 1, 4] [ ...
Eddie Curtis's user avatar
4 votes
3 answers
1k views

Finding the frequency of an element in a sorted list of integers

Input: Array of sorted integers and an element to check the frequency for Output: Frequency of the element ...
Neelesh Salian's user avatar
1 vote
2 answers
2k views

Sorting an Integer array

The program sorts the array from lowest to highest and outputs the index of the searched value: ...
crmepham's user avatar
  • 657
3 votes
4 answers
2k views

Median of two sorted equal sized arrays on combination

The comprehensive description of the problem can be found here. I'm looking for code review, clever optimizations, adherence to best practices. etc. This code is also a correction of code previously ...
JavaDeveloper's user avatar
9 votes
3 answers
27k views

Binary search for inserting in array

I have written a method that uses binary search to insert a value into an array. It is working, but i would like to get a second opinion to see if i didn't write too much code for it. aka doing same ...
WonderWorld's user avatar
6 votes
2 answers
10k views

Finding greatest value in array smaller than x

Code review requested to make this code simpler, cleaner, and better. Input array is sorted. This program finds the greatest number smaller than x. So, in an ...
JavaDeveloper's user avatar