View RSS Feed

All Blog Entries

  1. A recursive method for searching an array of integers...

    by , 03-08-2012 at 09:49 PM
    Java Code:
    public class ArrayLister {
    	
    	private static int arraySearcher(int[] arrayToSort,int numberToFind,int left,int right){
    		
    		int middle = (left + right) / 2 ;
    		System.out.println(middle);
    
    		if(middle==arrayToSort.length-1)
    		{
    			if(arrayToSort[middle] == numberToFind) {
    				return middle;
    			}
    			else
    				return -1;
    		}
    		
    		if(arrayToSort[middle] == numberToFind) {
    			return
    ...
    Categories
    Uncategorized
Page 16 of 48 FirstFirst ... 6141516171826 ... LastLast