Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void calc_seqMin(int vettore[],int len_vett,int &Occ_min,int &i_min)
- {
- i_min=0;
- bool cond=true;
- int cont=1;
- for(int i=0;i<len_vett;i++)
- {
- if(vettore[i]==vettore[i+1])
- {
- cont++;
- }
- else if(vettore[i]!=vettore[i+1] && cond==false)
- {
- if(cont<Occ_min)
- {
- Occ_min=cont;
- i_min=i;
- }
- cont=1;
- }else if(vettore[i]!=vettore[i+1] && cond==true)
- {
- Occ_min=cont;
- i_min=i;
- cond=false;
- cont=1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement