Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LsiInterclasare(Nod *h1, Nod *h2, Nod *&h)
- {
- Nod *orgh1=h1;
- Nod *orgh2=h2;
- Nod *h3=NULL;
- Nod *tail=NULL;
- while(orgh1!=NULL && orgh2!=NULL)
- {
- if(orgh1->info <= orgh2->info)
- {
- if(h3==NULL)
- h3=tail=orgh1;
- else
- {
- tail->leg=orgh1;
- tail=orgh1;
- }
- orgh1=orgh1->leg;
- }
- else
- {
- if(h3==NULL)
- h3=tail=orgh2;
- else
- {
- tail->leg=orgh2;
- tail=orgh2;
- }
- orgh2=orgh2->leg;
- }
- }
- if(orgh1==NULL)
- {
- if(h3==NULL)
- h3=orgh2;
- else
- tail->leg=orgh2;
- }
- else
- {
- if(h3==NULL)
- h3=orgh1;
- else
- tail->leg=orgh1;
- }
- h=h3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement