Pregled posta

Adresa bloga: https://blog.dnevnik.hr/prirodaa

Marketing

bubble1-eq

#include
#include
using namespace std;

void bubble(char p[], int n);
void ispis(char p[], int n);

int main()
{
const int vel=12;
char niz[vel]={'E','A','S','Y','Q','U','E','S','T','I','O','N'};
cout<<"Nesortirana lista:"< ispis(niz,vel);
bubble(niz,vel);
cout<<"Sortirana lista:"< ispis(niz,vel);

return 0; }

void bubble(char p[], int n)
{for(int i=0; i { for(int walker=n-1; walker>i; walker--)
{ if(p[walker] { int tmp=p[walker];
p[walker]=p[walker-1];
p[walker-1]=tmp;
} } }
return; }

void ispis(char p[], int n)
{ for(int i=0; i { cout< } cout< return;
}


Post je objavljen 03.04.2013. u 00:29 sati.