The Notes of Sagi Arsyad

-
See also: Other Geeks@INDC

News

Sagi Arsyad's Facebook profile

ASP.NET

My Organization

Browse by Tags

All Tags » Algorithm (RSS)
Library Sort
My Slide on Library Sort http://geeks.netindonesia.net/files/folders/47430/download.aspx Share this post: | | | |
Posted: May 13 2008, 09:23 AM by Sagi Arsyad | with no comments
Filed under:
Algorithm : Insertion Sort
#include <iostream> using namespace std; void insertionsort(int *arr, int size) { int i, j, temp; for(i = 1; i < size ; i++) { j = i; while( j > 0 && *(arr+j-1) > *(arr+j) ) { temp = *(arr+j); *(arr+j) = *(arr+j-1); *(arr+j-1) ...
Posted: Oct 05 2007, 02:06 PM by Sagi Arsyad | with no comments
Filed under: ,
Algorithm : Bubble Sort
#include <iostream> using namespace std; void bubblesort(int *arr, int size) { int i, j, temp; for(i = 0 ; i < size ; i++) { for(j = i+1 ; j < size ; j++) { if(*(arr + i) > *(arr + j)) { temp = *(arr + i); *(arr + i) = *(arr + j); *(arr...
Posted: Oct 04 2007, 02:18 AM by Sagi Arsyad | with no comments
Filed under: ,