0

Problem:
Given an sorted array of N distinct integers, find floor value of input 'key'. Say, A = {1, 2, 3,4, 5, 6,7, 8, 9, 10} and key = 7, we should return 6 as outcome.
How can I optimize my solution?
private static int CalclualteFloorValue(int[] _sortedarray, int l, int r, int key)
...