Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 18th, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public static void convergingPointer(int[] array){
  2.                
  3.                 int start = 0;
  4.                 int end = array.length -1;
  5.                
  6.                 while (start <= end){
  7.                        
  8.                         if (array[start] !=0){
  9.                                
  10.                                 start++;
  11.                                
  12.                         }else{
  13.                                
  14.                                 end = start;
  15.                                 end--;
  16.                                
  17.                         }
  18.                        
  19.                 }
  20.                
  21.                
  22.                
  23.                
  24.                
  25.         }