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.
pass the parameters as a refrence.
void unitconversion (double &lengthme, double &lengthcent);
remove the return statement in unitconversion
don't cout<<unitoutput(lengthme, lengthcent);
...
Errors:
1. You haven't called the unitconversion function.
2. A function can return only one value at time, you might pass the parameters as a reference.
3. don't cout<<unitoutput(lengthme,...
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;
I have made the above changes but segmentation fault still persists.
#include <fstream>
#include <iostream>
using namespace std;
I am trying merge sort an array of 5 numbers. g++ compiles the program without error but i am unable to execute due to segmentation fault 11. I have read the article on segmentation faults. I think...