An array arr a mountain if the following properties hold: arr.length >= 3 The…
Binary Search is an algorithm that is basically used for finding a particular Key i…