Shriram Kulkarni
Merge Sort

Merge Sort is a sorting algorithm.

We keep dividing the array till it is divided into the smallest unit (1 element per array). After dividing we sort the element with the adjacent element and merge them. This is done for each element and finally after merging we get the sorted array. The image below shows the graphical representation of the merge sort.

Below is the code for merge sort which uses recursion :

public class MergeSort {

public static void mergeSort(int[] array, int first, int length) {
int low = first;
int high = length;
if (low >= high) {
return;
}

int middle = (low + high) / 2;
mergeSort(array, low, middle);
mergeSort(array, middle + 1, high);

int low1 = middle;
int high1 = middle + 1;

while ((first <= low1) && (high1 <= high)) {
if (array[low] < array[high1]) {
low++;
} else {
int temp = array[high1];
for (int k = high1 - 1; k >= low; k—) {
array[k + 1] = array[k];
}
array[low] = temp;
low++;
low1++;
high1++;
}
}
}

public static void main(String[] args) {
int[] array = { 2, 3, 6, 10, 35, 15, 7, 8, 20, 17 };
System.out.print(“Original Array => “);
for (int i = 0; i < array.length; i++) {
System.out.print(“\t” + array[i]);
}
System.out.println();

mergeSort(array, 0, array.length - 1);

System.out.print(“Sorted Array => “);
for (int i = 0; i < array.length; i++) {
System.out.print(“\t” + array[i]);
}
}
}

The Wall

Rahul Dravid was born in the wrong era.

Mr. Dependable in any situation.

The Talent which was never acknowledged nor appreciated.

Whenever he achieved something it was always sidelined because someone else had achieved something.

Will you debut at Lords?

-> Ok, I will

I scored 95 but Saurav Ganguly’s 100 over shadowed mine.

-> Ok, there is always a next time.

Captain has been suspended for 1 test.

-> Ok, I will be the captain.

Who will field at Forward Short Leg.

-> Ok, I will stand.

Need someone at First Slip.

-> Ok, I will stand.

Opener injured. Need an opener.

-> Ok, I will open the innings.

We need to play 7 batsmen.

-> Ok, I will be the wicket keeper.

I scored 10,000 runs but on that day Virender Sehwag scored 300 so my achievement was sidelined.

-> Ok, not to worry.

I scored 13,000 runs but on that day Sachin missed his 100th century by 23 runs so again my achievement was sidelined.

-> Ok, not a problem at all.

Rahul Dravid was really a Gentleman and he actually played like it’s said about Cricket that it’s a Gentlemen’s Game.

You will be missed a lot Mr.Rahul Dravid. I am glad that I was born in the era when you played Cricket.

एक उनाड दिवस (९-१०-२०१०)

We had decided an overnight trip to Diveagar but it wasn’t possible as one of our friend’s was getting married soon.

So as decided we met at 7am (it was actually decided 6am :P) at Prashant’s place. Well we means Akhilesh, Suyash and me. Sorry forgot to tell who all were going, it was Prashant, Akhilesh, Suyash and me.

मस्त Tahmini Ghat मधून चालो होतो आजूबाजूची हिरवळ पाहत. आधी पेट पूजा हा आमचा नियम आहे पण आम्ही ठेव्हा ठरवल होत की Tamhini Ghat मध्ये breakfast करू. मस्त गरम गरम मिसळ आणि चहा आणि my favorite पोहे झाले खाऊन आणि निघालो परत आम्ही तिकडून. वाटला होत की दिवेआगर ला गर्दी असेल कारण weekend होता तरी काहीच गर्दी नव्हती. Beach वर बोटावर मोजण्या इतकच public होतं.



थोड्यावेळ beach वर time pass केला आणि मग जाम भूक लागली होती सो जेवायला गेलो. मस्त egg masala आणि fish fry खाला (मी only veg ), नुसता ‘ओर्पा’ चालू होतं आमचा :)

मग खर तर पाण्यात जायचा विचार होता पण आमचा खूप आल्सलो होतो म्हणून गाडीत AC लाऊन बसलो नुसते आणि अचानक काय हुकल माहीत नाही आणि आम्ही मुरड जंजिरा ला जायचा विचार केला पण परत जायला उशीर झाला असता म्हणून आम्ही Mahabaleshwar ला निघालो beach वर न जाता. आम्हाला फ्हीरायच होता rather driving करायच होता सो निघालो आम्ही. जाताना ह्यांना Mohabbatein style फोटो काधायची इच्चा झाली म्हणून थांबलो आणि Suyash ला Facebook साठी profile pic हवा होता.

Mahabaleshwar ला गर्दी होती as expected आणि हिरवळ [अर्थ कळला असेल हिरवळ चा तर चांगला नाही तर जाऊदे ;) ] पण मस्त होती. मग तिकडे गेलो की “Fresh Strawberry with Ice Cream आणि Veg Cheese Grill Sandwich ” खाला नाही तर पाप लागेल ना.


मग आम्ही रात्री जेवायला “Pan Card Club ” ला आलो.

सो आस आमचा दिवस होता की आम्ही नुसते drive करत होतो. ठरला होता एक आणि केला एक.

Breakfast in Thamini Ghat, then Lunch at Diveagar, then Fresh Strawberry with Ice-Cream and Veg Cheese Grill Sandwich at Mapro Garden (Mahabaleshwar) and then finally Dinner at Pan Card Club (Pune). 450Kms of driving and great fun.