Welcome to Geeks Portal Sign in | Join | Help
in
 
 

Browse by Tags

Sorry, but there are no more tags available to filter with.
  • 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) = temp; j--; } } } void insertionsort2(int *arr, int...
    Posted to The Notes of Sagi Arsyad (Weblog) by sagi on 10-05-2007
  • 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 + j) = temp; } } } } int main() { int arr[] = {3...
    Posted to The Notes of Sagi Arsyad (Weblog) by sagi on 10-04-2007
Page 1 of 1 (2 items)
 
 
Powered by Community Server (Commercial Edition), by Telligent Systems
Copyright © INDC, 2006. All rights reserved.