www.flickr.com

Balloon Sorting in C++

Tuesday, October 26, 2010 Posted by Glenn 0 comments

Question: What is a Balloon Sort?
Answer: BALLOON SORT is actually an another term for EXCHANGE SORT. So here it is:


The balloon sort is similar to its cousin, the bubble sort, in that it compares elements of the array and swaps those that are not in their proper positions. (Some people refer to the "balloon sort" as a "bubble sort".)


The difference between these two sorts is the manner in which they compare the elements. The balloon sort compares the first element with each following element of the array, making any necessary swaps


.
When the first pass through the array is complete, the balloon sort then takes the second element and compares it with each following element of the array swapping elements that are out of order. This sorting process continues until the entire array is ordered.

The balloon sort, in some situations, is slightly more efficient than the bubble sort. It is not necessary for the balloon sort to make that final complete pass needed by the bubble sort to determine that it is finished.

//Balloon Sort Function for Descending Order
void ExchangeSort(apvector &num)
{
int i, j;
int temp; // holding variable
int numLength = num.length( );
for (i=0; i< (numLength -1); i++) // element to be compared
{
for(j = (i+1); j < numLength; j++) // rest of the elements
{
if (num[i] < num[j]) // descending order
{
temp= num[i]; // swap
num[i] = num[j];
num[j] = temp;
}
}
}
return;
}

Sharing is so Easy:
StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook

Labels: ,

Tips para makapag move on

Friday, August 27, 2010 Posted by Glenn 0 comments

Well, ito na! Para lang sa akin, medyo madali lang mag move on kapag desidido ka na mag move on.

1. MAG-ARAL NG MAG-ARAL.
2. Stick with your friends
3. Go to church

  • Masturbate, watch porn xD
    4. Watch movies
    5. You might want to delete her/him on facebook. But I didn't delete her, baka kasi sabihin eh bitter ako. lol. But I did delete her number on my cellphone.

    Okay, I-emphasize natin ang 5 steps ko.

    1. Kung nagwowork ka na, edi mas maganda, iniisip ko lang na, mag-aral, grabe, pag busy ka, easy lang ang pag move on. Oo, pwede kang ma-stressed, pero worth it and stress mo kapag masakit ang puso mo.
    2. Stick ka lang sa barkada mo, dahil sa barkada mo, grabe ang tawanan, but sometimes I do go to school and go home alone. Masaya din ang alone. Try it.
  • 3. Go to church every sundays, ayan, effective itong step na ito. Pray to God. ^_^

    4. Watch movies, or you can even play any games you want. Makakalimutan mo siya. Basta magpaka-addict ka lang, wag mo lang pabayaan ang responsibilities mo. Wag mo siyang isipin. Ughh, mahirap talaga, as in tough ang pag move on. Pero just like what I've said, madali kung gugustuhin mo. Wag mo kasi siyang isipin, tang ina. Hindi ako nagmumura, pero dito lang. hehehe. Hindi ko kayang magmura sa personal.

    5. Unfriend mo siya? Wow. Ikaw bahala. Pero ako hindi ko ginawa iyon. Para mapansin niya na din ako minsan kapag naka online ako. hahaha. As if naman mamiss niya ako. Siya lang ang namimiss ko. Pero delete mo na din siya sa phone mo, kasi baka matempt ka na itext or icall siya gamit ang ibang number.

    DONE! Remember this bitch:
    The harder you fight to hold on to specific assumptions, the more likely there's gold in letting go of them.

    Sharing is so Easy:
    StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook

    Labels:

    Tutorial for Computer, Math, Photography

    Saturday, May 1, 2010 Posted by Glenn 1 comments

    Hello! I am a 2nd year student from University of the East Caloocan taking up BS Computer Engineering and I teach algebra and computer (hardware or programming) and Photography. I just need some work to use my extra time. Hire me for only P150.00/hr. text 09276316005 or email: glenn_boy13@yahoo.com you may leave a comment here: www.glennvon.com

    Loc: anywhere in Caloocan, or near in Sm North Edsa or Fairview

    Thank You!

    Sharing is so Easy:
    StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook

    Labels: ,