Minggu, 17 Januari 2010

Procedure Insert Ascending dan Descending di C++

//Procedure insertion askending
void isert_as(int data[],int jum){
int j;
float p;
for (int i=2; i<=jum; i++){ p = data[i]; j = i-1; while ((j>0)&&(data[j] > p))
{
data[j + 1] = data[j];
j = j-1;
}
data[j+1] = p;
}
cout<<"Data setelah di urut :"; for (int i=1; i<=jum; i++){ cout<0)&&(data[j] < p))
{
data[j + 1] = data[j];
j = j-1;
}
data[j+1] = p;
}
cout<<"Data setelah di urut :";
for (int i=1; i<=jum; i++){
cout< }

}

0 comments:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Enter your email address to subscribe:

Delivered by FeedBurner

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo