Norman SchwarzkopfThe more you sweat in peace, the less you bleed in war.
Author Archives: Gaurang
Shell Sort
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
package com.gaurangjadia.code.sorting; import java.util.Random; public class ShellSort { public Random rdmNumber = new Random(); public int[] intArray = new int[10]; public static void main(String[] args) { ShellSort object = new ShellSort(); object.setRandomArray(object.intArray); System.out.println("Randomized Array:"); object.printArray(object.intArray); object.intArray = object.doShellSort(object.intArray); System.out.println("Sorted Array:"); object.printArray(object.intArray); } public int getRandomNumber(){ int intRandomNumber; intRandomNumber = rdmNumber.nextInt(100); return intRandomNumber; } public void setRandomArray(int[] array){ for(int i=0; i < array.length; i++){ array[i] = getRandomNumber(); } } public int[] doShellSort(int[] array){ int n = array.length; int ino = (int) n / 2; while(ino > 0){ for(int i = ino; i < (n - 1); i++){ int temp = array[i]; int j = i; while(j >= ino && array[j - ino] > temp){ array[j] = array[j - ino]; j = j - ino; array[j] = temp; } } ino = (int) (ino / 2.2); } return array; } public void printArray(int[] array){ for(int i=0; i < array.length; i++){ System.out.print(array[i] + ", "); } System.out.println("\n"); } } |
Klose To My Soul by Sonu Nigam at Nokia Theatre L.A. LIVE on May 31, 2014
We went to Sonu Nigam’s live concert called Klose to My Soul in association with Sankara Eye Foundation. It was at Nokia Theatre L.A. Live, Los Angeles, CA.
Hello family.. Seattle today and Los Angeles 2mrrw. My home LA. Nokia Theatre. Sold out since 3 weeks. Gives me a lump in d throat. Lv u all
— Sonu Nigam (@sonunigam) May 30, 2014
@sonunigam thanks a lot for amazing show tonight! Just loved it #KloseToMySoul #Extravagant pic.twitter.com/lCasU2YiHt
— Gaurang Jadia (@jadiagaurang) June 1, 2014