Help authour, Buy PDF Ebook >>>Click Here<<<
Data Structure Questions and AnswersBinary Search Iterative
Question 1 
What is the advantage of recursive approach than an iterative approach?
Consumes less memory  
Less code and easy to implement  
Consumes more memory  
All of the mentioned 
Question 1 Explanation:
A recursive approach is easier to understand and contains fewer lines of code.
Question 2 
Choose the appropriate code that does binary search using recursion.
public static int recursive(int arr[], int low, int high, int key) { int mid = low + (high  low)/2; if(arr[mid  
public static int recursive(int arr[], int low, int high, int key) { int mid = low + (high + low)/2; if(arr[mid
Iconic One Theme  Powered by Wordpress
