Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

feel thread

Name: Anonymous 2012-06-03 13:58

that feel when your handwritten linked_list in C is 5 seconds faster than the STL

Name: Anonymous 2012-06-03 16:20

>>4
Oh the bloat! This is all you really need:
typedef struct _qListNode
{
    int elem;
    struct _qListNode * next;
}qListN;

void addItem(int item, qListN * listop)
{
    qListN * head = listop;
    while(listop->next != 0) listop = listop->next;
    listop->elem = item;
    listop->next = (qList*)calloc(1,sizeof(qListN));
    listop->next->next = 0;
    listop = head;
}


Removal and sorting can be done when operating on the list and doesn't need a dedicated function.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List