Label

  • ActionScript 2
  • AD Player 2
  • Algorithm 2
  • AS3 16
  • Audio 1
  • Audio Description Player 1
  • Bitmap 1
  • BitmapData 1
  • Browser 1
  • C# Experience 4
  • Chart 1
  • Flash 10
  • Game 1
  • Geometry 1
  • JavaScript 2
  • Mathematics 6
  • Music Online 1
  • MVC 1
  • Performance 1
  • PureMVC 1
  • Slide 1
  • Talks 1
  • Tool 1
  • Tool Player 1
Toggle Side
Home   »   Algorithm   »   Bubble Sort

Bubble Sort

After a series bad days, I decided to take back the spirit begins with a request from my teacher, here's a small demo of sorting algorithm



ActionScrip 3 code demo:
var temp: int = 0,
i: int = 0,
j: int = 0,
array: Array = [];

function BubbleSort(n: int) {
for (i = 0; i < n - 1; i++) {
for (j = i + 1; j < n; j++) {
if (array[i] > array[j]) {
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
}

References


  1. https://en.wikipedia.org/wiki/Bubble_sort
  2. http://rosettacode.org/wiki/Sorting_algorithms/Bubble_sort
  3. http://code.tutsplus.com/tutorials/quick-tip-implementing-the-bubble-sort-in-as3--active-10728
  4. https://www.hackerearth.com/notes/sorting-code-monk/
  5. https://www.quora.com/What-is-the-fastest-sorting-algorithm

Main idea


  1. http://trucntt.webchuyennghiep.net/mophongthuattoan3/

Download

Source here: https://drive.google.com/open?id=0B8jxLPprSFg1TWVENmZ4SEE3SjQ

Labels: Algorithm   at:  4:09 AM     Email This BlogThis! Share to X Share to Facebook

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom)
© Hung Le 2007-2016. Powered by Blogger