1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

linear register

Discussion in 'C' started by logistic, Jun 6, 2007.

Thread Status:
Not open for further replies.
  1. logistic

    logistic New Member

    Joined:
    Jun 6, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Hi, i'm sorry for bothering you, i wanted to arrange numbers (ascending), i tought everything is ok, but... where's the problem? Thanks...

    Code:
    void sort(){
    elementi *temp = first, *next, *t1, *t2;
    
    for(next = temp->next; next !=NULL; next = temp->next){
    next=temp->next;
    if(temp->value > next->value) {
    
    if(next!=last){
    t1=temp;
    t2=next;
    t1->next=next->next;
    temp=t2;
    next=t1;}
    
    else { t1=temp;
    t1->next=NULL;
    t1=last;
    temp=temp->next;
    temp->next=t1;
    }}
    
    else {  
    temp = temp->next;
    }}
    };
    
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Duplicate of [thread=240]linear register[/thread]. Thread closed.
     
Thread Status:
Not open for further replies.

Share This Page