It is working fine.
I was required to use selection sort. However I was wondering if the number of loop executions, the number of if statements or the number of pointers used could be reduced.
Type: Posts; User: Chanakya
It is working fine.
I was required to use selection sort. However I was wondering if the number of loop executions, the number of if statements or the number of pointers used could be reduced.
Help me make this code more efficient.
void llist::sort()
{
int val,val1;
for(node *p = first, *p1, *pos; p->next != NULL; p = p->next)
{
val = p->info;
pos = p;